From the course: Building Production-Ready React Apps: Setup to Deployment with Firebase
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Manage the state with the Context API: Custom hook
From the course: Building Production-Ready React Apps: Setup to Deployment with Firebase
Manage the state with the Context API: Custom hook
- [Instructor] So now we want to continue with the setup of first the authProvider, and next we want to then allow to wrap around this app component, the root component, so we can allow descending components, to access the global state and then subscribe to the context changes. So we're going to finish with the setup of this login method. So that's going to be signing, it's going to return it premise, and we're going to pass that current user. Meaning that the result of this premise, once this is fulfilled, will be passed as a value, a new value to current user. So then we're going to be able to update every descending component with the value of the user, current user, like so. And for sign out, it's going to be, actually let me check if it is also Auth. Yeah, it returns a premise, just wanted to check. Same, it's going to be then, and then here we're going to set this back to null. And just to tell the rest of the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
(Locked)
Start with Firebase Authentication and select the provider2m 57s
-
(Locked)
Google Cloud Platform: Create new credentials3m 17s
-
(Locked)
Authenticate and manage users from the application5m 46s
-
(Locked)
Manage the state with the Context API: Component Provider5m 3s
-
(Locked)
Manage the state with the Context API: Custom hook5m 34s
-
(Locked)
Subscribe components to the context changes: User connected4m 59s
-
(Locked)
Create new documents with the user connected5m 26s
-
(Locked)
Secure your data in Cloud Firestore and Cloud Storage5m 43s
-
(Locked)
-
-
-
-