In this lesson you will learn how to structure an auth flow in an application using React Navigation. In the process you will learn how to use a navigator’s screenProps
to access parent functions and React Native’s AsyncStorage to persistent auth state between sessions.
Cool video. I noticed you are using the deprecated componentWillMount. Is there a plan to update the video or code?
@David you could use componentDidMount for the same thing. No plans to update the video as it doesn't change much from what is the focus of the lesson.
Great stuff! I was just curious, can you pass the signIn/signOut functions through regular props? Or do these callbacks have to be through screenProps
?
@Michael - good question! You'll need to pass them through screenProps otherwise React Navigation won't pass them down the screens. They'll just never get exposed anywhere.
@Spencer, thanks so much for the quick response, that makes perfect sense! I've been comparing it to react-router
usage.