Skip to content

Using linking prop with protected routes #11681

Discussion options

You must be logged in to vote

Found the solution myself tho it could probably be added to the docs. Rendering two navigation containers did the trick

...
const isAuth = useAuth()
    
return isAuth ? (
  <NavigationContainerc key={1}>
    <LogIn />
  </NavigationContainer>
) : (
  <NavigationContainer key={2} linking={yourLinkingConfig}>
    <ProtectedScreens />
  </NavigationContainer>
);

...

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by arnoldo-rodriguez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant