0
Is there any way to do programmatic navigation using lib @React-navigation in React Native?
I am validating outside the React files . JSX and wanted to "push" a route if any conditions are met
0
Is there any way to do programmatic navigation using lib @React-navigation in React Native?
I am validating outside the React files . JSX and wanted to "push" a route if any conditions are met
0
I was able to solve using a Navigation Container reference from React Navigation as per documentation and inside the function outside the component calling this reference.
Browser other questions tagged javascript typescript react-native react-navigation
You are not signed in. Login or sign up in order to post.
If you pass the object
history
for this function, can usehistory.push
. I don’t know if this logic makes sense, I think taking navigation from the component can hinder the understanding of the code, since an external function would be modifying the state of the application.– Rafael Tavares
Hook useNavigation would not help?
– Jhonny Freire