Last active
August 7, 2021 08:51
-
-
Save imranariffin/fcc649a4f30a1f70dc6f50d1873c4832 to your computer and use it in GitHub Desktop.
React Native Private/Public Screen Pattern - Wrap the `@react-navigation/stack` to be auth aware (Note: replace `.` in file names with `/` to make more sense)
Hello , thanks for this code
but i keep receiving this error: Error: A navigator can only contain 'Screen' components as its direct children (found 'undefined' for the screen 'Login')
Is there anyway to resolve it ?
Its been a while since I've use React but it seems like you passed an undefined
value in <Login ...>
. Share some code?
Thanks hbina for responding i've used another method to solve the problem , !
I keep get error Error: A navigator can only contain 'Screen' components as its direct children (found 'undefined' for the screen 'Login')
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Agreed, someone else has also pointed out this issue on Reddit.
I think your fix would work (plus a one-line amendment as above) but I will try to create a repo to test this when I have time.
Edit: Now the gist has been updated with a fix similar to @hbina's suggestion