Saving our user
The user object we received in response to our firebase.auth().signIn seems like it'll be useful down the line. There may be numerous times we want access to the email of the currently signed-in user. Let's go ahead and save that in the state of our App component so that we can then pass it down to any Container component (once we make more containers).
There are two possible approaches: we can pass up the user object from LoginContainer to App via a callback through props, and App will pass a handleLogin function to LoginContainer as a prop, which will be called when the user logs in and sets the state of App appropriately.
Firebase gives us another option, however. As we discussed earlier, the Firebase database is real-time, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access