Depending on what you're trying to do, it's not as simple as it would seem. See my implementation here and here. It does more than
BackHandler
but it supports
BackHandler
and keeps the browser and CMP navigation in sync across all platforms.
e
Eugen Martynov
09/13/2024, 10:24 AM
Thanks, I'm mobile dev doing small web app, so no idea what is navigation in browser is. After researching I have an idea how things could be implemented, done, etc. Thank you for the examples!
a
Alex Styl
09/15/2024, 9:23 AM
@Eugene Garagulya as Eliezer said it really depends what you are trying to implement.
Are you trying to detect when the user is trying to navigate away or when a specific key was pressed?