Reactive customRouter #11488
Unanswered
Romaric-CH
asked this question in
Q&A
Replies: 1 comment
-
I have a very similar case and I am wondering whether the issue is not coming from this line https://github.com/react-navigation/react-navigation/blob/6.x/packages/core/src/useNavigationBuilder.tsx#L279 where the router is defined as a ref and therefore persisted with its initial config whenever the state changes and the Navigator re-renders. I guess there must be a reason for using a ref here but I haven't found out yet. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi 👋
I'm using react-navigation for a complex application and a custom router to block user navigation or to redirect him to other screens based on its context.
I want this custom router to be dynamic to match user context modifications.
Here is a really quick POC of what I want to achieve : https://snack.expo.dev/sPiRupn6S
If you manually change the initial value of
cguAccepted
of theCustomNavigator
component it works well.But if you dynamically change this value (for exemple with a fetch or in this exemple with a button), the new router behavior doesn't change.
Do you know if a dynamic behavior is possible with a custom router ? I mean without using route params.
Thanks for your help
Beta Was this translation helpful? Give feedback.
All reactions