Closed danielkv closed 3 years ago
Could you write what you would code with RN and what you'd expect to happen if this were a feature?
Does this not work?
const { replace } = useRouting()
Does this not work?
const { replace } = useRouting()
I'm actually trying the replace
method right now, but the replace method, replaces only the last route right?
This is the exact code I have on my Login page. It runs right after the user Logs in:
import navigation from 'react-navigation/native';
[...]
navigation.reset({
index: 1,
routes: [
{ name: 'Home' },
{ name: 'MyAppointments' }
]
});
Hmm I see. If you were using Next.js, what would you do here, just replace?
In my app, when someone signs in, I show them a “welcome” screen with the option to go back.
In my auth screen:
if (user) return <Welcome />
And when they close that, they no longer have a way to get back to that screen.
And then I set the tabs as a function of my state, depending on users who have logged in. I find this to be a better practice, since everything is a function of your state. Could you do that?
Hmm I see. If you were using Next.js, what would you do here, just replace?
I haven't thought it through kkk. But I think I'd do standard navigation. Probably using replace
. I was just wondering if it was possible to reset with this lib. Actually it's not a big deal. I could do as you suggested. it's also good solution!
Thanks again!
In
react-navigation
I can "reset" the navigation.Example:
I can do this with
react-navigation
but I didn't figure withexpo-next-react-navigation
. I know, on web the browser has the history, is completely different. But there is a way to do in mobile and bypass in browser?