<SafeAreaView>
<NativeRouter>
<Routes>
<Route path="/" element={<Main/>}/>
<Route path="one" element={<One/>}/>
<Route path="second" element={<Second/>}/>
</Routes>
</NativeRouter>
</SafeAreaView>
This is the router structure created using react-router-native
. This app closes when you press the back button on Android.
Is it possible to make the app go to the previous router without exiting when the back button of the android hardware is pressed?
I found a function called useAndroidBackButton
in react-router-native
v6, but I don't know how to use it.