React Firebase Authentication Crash Course With Context API and Protected Routes For Beginners

2024 ж. 9 Мам.
73 614 Рет қаралды

In this video we will explore the React + Firebase Authentication combo. We build an Authentication App to create new users, login and logout functionality. We will see how to use Context Api to management Auth state in the application.
We will also build Google Sign using Firebase Google Authentication Provider and make the protected routes accessible only to Authenticated Users. So we have a lot to learn in this 50 minutes tutorial.
Please use the timestamps mentioned below to jump to any topic and also checkout the reference videos and links.
Node.js: The Complete Guide to Build Backend Projects [2023]🔥
Link - www.dipeshmalvia.com/courses/...
⭐️GitHub link for Reference⭐️
github.com/dmalvia/React_Fire...
⭐️Reference Videos and Links⭐️
firebase.google.com/
react-bootstrap.github.io/
reactrouter.com/docs/en/v6/ge...
Protected Routes - • Protected Routes in Re...
Context API - • React Context API Tuto...
⭐️ Support my channel⭐️
www.buymeacoffee.com/dipeshma...
🔥 Video contents... ENJOY 👇
0:00:00 - Intro
0:00:20 - Application Demo
0:02:32 - Code Walkthrough
0:05:15 - Firebase Project Setup
0:06:53 - Install Firebase and Config Setup
0:07:45 - Enable Firebase Authentication
0:10:13 - Adding Routes (React Router version6)
0:14:34 - Context API for Authentication
0:22:50 - Signup Component Firebase Integration
0:31:00 - Login Component Firebase Integration
0:35:08 - Firebase Protected Route Setup
0:42:58 - Adding Firebase Logout Functionality
0:44:20 - Sign In With Google
0:48:52 - Forgot Password Assignment
0:49:51 - App Testing
0:50:13 - Outro
**React Roadmap for Developers in 2021**
How to Learn React JS ? - • React JS Roadmap for D...
React in One Project - • Learn React JS with Pr...
React Redux Toolkit Tutorial - • React Redux Toolkit wi...
Learn React Redux with Project - • Learn React Redux with...
What is Redux ? - • Understanding Redux Co...
Learn React Redux Thunk with Project - • Learn React Redux Thun...
Learn React Hooks - • Learn React JS Hooks |...
🔗 Social Medias 🔗
Twitter: / imdmalvia
Facebook: / programmingwithdipesh
Instagram: / dipeshmalvia
LinkedIn: / dmalvia
⭐️ Tags ⭐️
- React Firebase Authentication Tutorial
- React Firebase Login Authentication
- Firebase Google Authentication
- Context API And Protected Routes
- Firebase v9 Crash Course
⭐️ Hashtags ⭐️
#react #firebase #authentication #tutorial
Disclaimer:
It doesn't feel good to have a disclaimer in every video but this is how the world is right now.
All videos are for educational purpose and use them wisely. Any video may have a slight mistake, please take decisions based on your research. This video is not forcing anything on you.

Пікірлер
  • Guys, if the video is helpful to you or you learned something than please appreciate and hit the LIKE and SUBSCRIBE button and help this channel to GROW😉

    @DipeshMalvia@DipeshMalvia2 жыл бұрын
    • when we login for the second time with google signin which was already registered it was overwriting the previous auth can you help me out

      @jeevankrishnagorrepati1599@jeevankrishnagorrepati15992 жыл бұрын
    • after u login u redirect to some other page but when u enter login manually in address bar it logs u out and shows login page again how to deal with that

      @smitagravat1063@smitagravat10632 жыл бұрын
    • Really good and clear explanation. I think though there is a little detail in the logOut function. You should set the user to the default value, in my case, null function logOut() { setUser(null) return signOut(auth); } regards!

      @nisara2510@nisara25102 жыл бұрын
    • @@jeevankrishnagorrepati1599 did you get the sol

      @kavascgjmd5790@kavascgjmd5790 Жыл бұрын
    • thank you so much

      @devsuthar6272@devsuthar6272 Жыл бұрын
  • Thanks so much! This really helped me to understand the authentication process. I had been completely stuck and overwhelmed but this video really made sense and made it easy.

    @danielmalede@danielmalede Жыл бұрын
  • Thanks a lot man! This class was very userful!!!

    @carlosnani@carlosnani Жыл бұрын
  • This video is so easy to understand , follow and also well detailed! Thank you.

    @kanuchinaza2984@kanuchinaza298411 ай бұрын
  • you are a very good teacher, it's rare to find teachers that are precise and direct and at the same time very clear in explanation. Thank you.

    @DexterrrrX@DexterrrrX10 ай бұрын
  • Hi, I am currently trying to wrap the app component with the context provider as shown. I am using NextJS and every time I wrap the _app.js; the page just breaks with no console errors. Just goes blank on my local host. Hopefully this is enough information that you can help me with. Thanks

    @TheAppliancePlug@TheAppliancePlug Жыл бұрын
  • You've got a sub from me dude! Awesome work!

    @clintbriley1892@clintbriley18922 жыл бұрын
  • The best video about Auth with React and FireBase on KZhead! Trust me!

    @user-bu2yv2uz3h@user-bu2yv2uz3h2 жыл бұрын
  • I don't usually comment, but thank you. You are very helpful and clear when explaining how things worked. Loved the video! Keep up the good work.

    @Disguised_Angel@Disguised_Angel2 жыл бұрын
    • Glad it helped!

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • Your videos are really informative. Thanks for your effort. This tutorial is also well designed. Thanks again.

    @talatkuyuk6556@talatkuyuk65562 жыл бұрын
  • Great explanation. Very helpful. Appreciate your effort. Thank you.

    @aviworld1995@aviworld19952 жыл бұрын
  • Very nice & quick explanation to cover the entire topic. Wonderful 😀

    @surajdedhia9584@surajdedhia95842 жыл бұрын
  • Genial hermano. muchas gracias, habia visto muchos videos pero ninguno me sirvió como este.

    @danieldeavila557@danieldeavila5572 жыл бұрын
  • Excellent!

    @aburaihan-py4vi@aburaihan-py4vi8 ай бұрын
  • Thankyou sir for this tutorial it was really helpfull bit confused on useEffect part

    @saugatmainali7784@saugatmainali77842 жыл бұрын
  • A Clean Way to Learn Authentication , Highly Appreciated❤❤😊😊

    @salamsheikh5648@salamsheikh5648 Жыл бұрын
  • Thank you soo muchh!!!! This was very very helpful!!!!!! You are an absolute gem! I was stuck on this for a while but your video helped me implement authentication! 💖

    @priyanshramnani1751@priyanshramnani17518 ай бұрын
  • You are the GOAT🐐. Thanks for everything.

    @rakeshkundu2872@rakeshkundu2872 Жыл бұрын
  • i'm gonnnu give a big thumps up👍 and dab

    @adityarout1276@adityarout12762 жыл бұрын
  • thank you soo much sir , it was soo helpful and you made it soo easy to understand for us. ❤❤

    @AyushKumar-16999@AyushKumar-16999 Жыл бұрын
  • 🤜🤜Thanks a lot your content is very useful

    @manqobangubeni6172@manqobangubeni61722 жыл бұрын
  • Excellent ! Thank you for your clear explanations

    @alainroos5383@alainroos5383 Жыл бұрын
    • Glad it was helpful!

      @DipeshMalvia@DipeshMalvia Жыл бұрын
  • Another Banger!👌

    @imkir4n@imkir4n2 жыл бұрын
    • Thanks!

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • Thanks for this... it's really helpful...

    @muhammadrabbi2211@muhammadrabbi2211 Жыл бұрын
  • hey Dipesh its really Awesome and useful to create firebase login and logout system

    @pasalapranathi9015@pasalapranathi9015 Жыл бұрын
  • EXACTLY WHAT I REALLY NEED FOR MY SENIOR PROJECT. YOU ARE A GOD.

    @quanduong3390@quanduong33907 ай бұрын
  • Thanks! It's very helpful for me

    @mohammedshahid6663@mohammedshahid66632 жыл бұрын
    • Glad to hear that!

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • Thanks for this video

    @osman_akdag@osman_akdag2 жыл бұрын
  • Very Helpful. Thanks for using the latest features of React Router.

    @indrasen9617@indrasen96172 жыл бұрын
    • Glad it was helpful!

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • Your explanation on concepts is very good bro

    @hi-yi7en@hi-yi7en2 жыл бұрын
  • Wow this is the exact tutorial I was looking for

    @Turingtechs@Turingtechs6 ай бұрын
    • Wonderful! Hope you enjoyed the tutorial!

      @DipeshMalvia@DipeshMalvia6 ай бұрын
  • Excelent video!

    @pablomarino@pablomarino Жыл бұрын
  • Great video for learning Authentication, You are changing people's lives.

    @anandkrg@anandkrg8 ай бұрын
  • Nice video, very understandable, Thank you so much.

    @tahirmahmoodhashmi7418@tahirmahmoodhashmi74182 жыл бұрын
    • Glad it was helpful!

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • Great video ❤ Thank you so much for being very helpful and clear in your instructions. Keep the good work going 💯

    @shubhamokay@shubhamokay7 ай бұрын
    • My pleasure 😊

      @DipeshMalvia@DipeshMalvia7 ай бұрын
  • thank you my friend :)

    @deniz-wt8go@deniz-wt8go Жыл бұрын
  • Excellent

    @Lotus-kb2vg@Lotus-kb2vg Жыл бұрын
  • I just realized ChatGPT will never be as helpful as these excelent indian programmers lmao. Well done man! You have no idea how helpful this video was, keep the good work:D

    @jppd0657@jppd0657 Жыл бұрын
  • Thanks Dipesh.....this was really helpful

    @dcode721@dcode7212 жыл бұрын
    • Thanks!

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • This tutorial is so amazing 🔥🔥

    @eliuddyn@eliuddyn Жыл бұрын
    • Thanks and glad you liked it!

      @DipeshMalvia@DipeshMalvia Жыл бұрын
  • Great Explanation as always Dipesh. I am successfully able to add firebase Authentication in my website. Although, I got stuck for 24 hrs at one issue but just now I found out I made a mistake in component will Unmount('unsubscribe') method. React Rocks !

    @KaranSingh-rn2zk@KaranSingh-rn2zk2 жыл бұрын
    • That's wonderful. 👍

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • Very helpful sir im learning react through your videos...thank you so much.

    @paltechy@paltechy2 жыл бұрын
    • That's awesome! Keep learning

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • Thanks alot for this been looking for how to do it for months........ one issue though whenever the i enter the protected routes if i refresh it'll take me back to login page and i'll like to integrate firestore with it also

    @olaitanmichael6025@olaitanmichael60252 жыл бұрын
  • nice explaination bro

    @ValpaliVenkatesh@ValpaliVenkatesh Жыл бұрын
  • Really helpful this video... Thank you so much... Sir❤️❤️

    @faisalahmad100@faisalahmad1002 жыл бұрын
    • Most welcome 😊

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • Thank you for this Tutorial sir

    @michaelcaligner4636@michaelcaligner46362 жыл бұрын
  • awesome video, can you make or recommend how to make the role base or multiple login react with firebase database?

    @MYusup-yf7lu@MYusup-yf7lu5 ай бұрын
  • Awesome video +++++++++++++++ Thank you 😃

    @mohamedyoussef8835@mohamedyoussef8835 Жыл бұрын
  • you are the best

    @AdityaAditya-il6ng@AdityaAditya-il6ng11 ай бұрын
  • Thank you sir

    @itinfo8931@itinfo89318 ай бұрын
  • Hi Dip .. Really nice video … I have implemented the Microsoft provider but pop up instantly closes and in console it say auth/internal-error I have checked all the settings of azure and firebase , all seems ok Any thoughts on this Contacting viva react app

    @mechvishwanath@mechvishwanath11 ай бұрын
  • Nice lesson Thank you

    @azimabdumutalibov7647@azimabdumutalibov76472 жыл бұрын
    • Glad you liked it!

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • Hey @dipeshmalvia what should I do if a logged in user can access the login page after successful login after clicking back button. It should redirect to dashboard/home page. Please suggest something as I am trying to do it from 2 days.

    @chaitanyadani4273@chaitanyadani42732 жыл бұрын
  • Ur videos are amazing brooo thanksss bhai

    @BABLUKUMARBAMBAL@BABLUKUMARBAMBAL2 жыл бұрын
    • Thanks and welcome!

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • what if my login and signup codes are in different components where should I setup the authState Persistence?

    @mirzaraza3542@mirzaraza35422 жыл бұрын
  • very helpful and informative

    @rajnishkalwar3231@rajnishkalwar3231 Жыл бұрын
    • Thanks! Glad it was helpful!

      @DipeshMalvia@DipeshMalvia Жыл бұрын
  • Neat and clean.. Bro..

    @dineshj1998@dineshj19982 жыл бұрын
    • Thanks 👍

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • hey! buddy I want ur help. I've configured firebase for my project for google sign in using popup and idk why the popup is not opening on my localhost, but as soon as I close the server, it opens. it;s really weird and I'm frustrated. I've tried all the tips from StackOverflow, downgraded the firebase version to 8 also. nothing worked. plssssss help!!!!

    @196_shubhamsabat7@196_shubhamsabat72 жыл бұрын
  • Thanks a lot for the great content and the explanation too! Could you please do a full-stack authentication maybe with Rails as a backend and PostgreSQL for database 🙏

    @haveneldebaque9435@haveneldebaque94352 жыл бұрын
  • great tutorial however I have got an error on the firebase regarding the google sign in, the error is auth/auth-domain-config-required

    @allymbaya2701@allymbaya2701 Жыл бұрын
  • You are a god

    @leonardospecht4779@leonardospecht47792 жыл бұрын
  • Great work sir. I'm trying to include a loading state when a user tries to login. I tried it out but, I've encountered so many errors. Can you or anyone help me with this?

    @kachidereodumeh2040@kachidereodumeh20407 ай бұрын
  • Sir, you may have just saved my graduation

    @chloe_delinah@chloe_delinah Жыл бұрын
  • After pressing refresh button on home screen I keep getting sign out and redirected to login page, how to solve it?

    @Speede04@Speede0410 ай бұрын
  • Hi @Dipesh I followed your tutorial and it worked fine for me. I am trying to implement the forget password and reset password email but its not working. Can you please help

    @SolomonRazak@SolomonRazakКүн бұрын
  • I am getting error in value in userAuthContext.Provider

    @tp2133@tp2133 Жыл бұрын
  • Can u do same video it with apple id sign in and Google sign in.

    @bravo1oh1@bravo1oh1 Жыл бұрын
  • error handling with try and catch doesnt work , solutions ??

    @tareshgupta1095@tareshgupta10957 ай бұрын
  • whenever i login with registered user and then refresh i redirect to login page and currentUser state becomes null. idk why

    @mihirlakhamje9575@mihirlakhamje95755 ай бұрын
  • In userAuthContext file..it is not allowing to take useStare nd useEffect as...usercontexprovider is not a part of react

    @sadiyakhan2795@sadiyakhan2795 Жыл бұрын
  • Sir followed your whole code but one signup function is not working..here is the problem TypeError Cannot read properties of undefined (reading 'userSignUp') const {userSignUp} =userAuth() this line is showing error

    @ijajulislam7223@ijajulislam72232 жыл бұрын
  • thank you bhai, mja aa gya ab firestore and storage pr video aa jaye to mja hi aa jayega

    @RahulGupta-yl3jk@RahulGupta-yl3jk2 жыл бұрын
    • Video already aa gya hai bhai...check the lastest upload

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • Thanks ❤️

    @hridoy5585@hridoy55852 жыл бұрын
    • You're welcome 😊

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • 22:35 you can return only ref to the unsubscribe function, without anonymous wrap function :) By the way, great tutorial!

    @KarolCud@KarolCud2 жыл бұрын
    • Thanks for that!

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
    • I think I am getting an error because of that but I am not sure. When I login and try to redirect I get white screen and the following errors: - Class constructor Button cannot be invoked without 'new' - Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. Can you help me or at least tell me what the problem might come from? I just started to learn React so I don't really know what to do here.

      @catagreendevil@catagreendevil2 жыл бұрын
    • I found the problem, the problem is in the Home page with the bootstrap Button. If I use a normal JSX , I don't get the error anymore.

      @catagreendevil@catagreendevil2 жыл бұрын
    • @@catagreendevil Class constructor Button cannot be invoked without 'new' import { Card, Form, Button, Alert, Container } from "react-bootstrap"; **import from react-bootstrap not from bootstrap - this solve my problem

      @maheshtamrakar292@maheshtamrakar292 Жыл бұрын
  • sir how to add admin role and user role ? any video for that

    @divvukancherla9817@divvukancherla98175 ай бұрын
  • Can you make with a custom user claims like this

    @johnpaulpineda2476@johnpaulpineda24762 жыл бұрын
  • Very informative video sir Really appreciated. I am having an error since a week now Saying element type is invalid expecting a string or a class/function but what undefined you're likely forgot to export your component from the file it's defined in or you might have mixed up defaults and name imports

    @roshanbhattad4493@roshanbhattad44932 жыл бұрын
    • i've the same error, do u got the solution ? please

      @Mohamed-Ba@Mohamed-Ba2 жыл бұрын
  • When you create an account it is automatically keeping you signed in. So thats not working as it looks in the background at all.

    @tristanhurley9071@tristanhurley9071 Жыл бұрын
  • Amazing walkthrough! You explained everything! I was having quite hard time with redirecting and protected route before, but after following your tutorial I managed to implement it! Great content! However, I have one issue, when I reload the page from the protected route, the Login page will be displayed and not the protected one, even though I'm already logged in... any thoughts?

    @flpmko@flpmko2 жыл бұрын
    • Thats because the "user" is only a state, which is cleared when you refresh the page. You can use the setPersistence(auth, browserLocalPersistence) to save the user in localstorage, and when the page loads the first time (useEffect), you check if there is any value in localstorage and fill the user state with that data. This way you will keep logged in. With this method, when you signOut() the localstorage is automatically cleared.

      @Gustavo-nz1vt@Gustavo-nz1vt2 жыл бұрын
    • @@Gustavo-nz1vt oh yeah, I thought I would need it to store in local storage, but thanks to you, I can now use setPersistence and not do it manually myself! Thank you!

      @flpmko@flpmko2 жыл бұрын
    • hey dude, i just left a comment regarding this but i will reply with it here again. @38:13 -- when you refresh the page, it logs the user out even tho technically the user is logged in and the UI makes it appear like the user is logged out the way u fix this is you put the 'onAuthStateChanged' function inside 'ProtectedRoute.js' AND you create a useState like so: const [user, setUser] = useState({}) onAuthStateChanged(auth, (currentUser) => { setUser(currentUser); }); just make sure you import the onAuthStateChange function and the 'auth' from 'UserAuthContext.js' into 'ProtectedRoute.js' the if statement should be left as is and when u refresh your authentication should persist. You do not need to use Local Storage

      @westernpigeon@westernpigeon2 жыл бұрын
    • @@westernpigeon thanks, I fixed it with firebase function setPersistence, where you can set either local storage, session storage or no persistence. I set it to session storage and it works fine :)

      @flpmko@flpmko2 жыл бұрын
    • @@flpmko Hey, do you have any tutorial or link you followed. I want to work on this.

      @manishpaudel6515@manishpaudel65152 жыл бұрын
  • A bug i am facing : I am displaying a ("/") home component, which is unprotected and i am displaying a button on that which is for login, when i click i go to login ("/login"), and same for signup, The issue is when i am signing up, and redirecting to login so that user logins and then goes to the protected route. But right after signup, my unprotected routes are getting unlocked and i am able to access it right after signup and before login.

    @piyush5764@piyush57644 ай бұрын
  • I was looking for a video for a junior developer, unfortunately it skips too much of the UI building part.

    @danielzuzevich4161@danielzuzevich4161 Жыл бұрын
  • Well done with easy step-by-step explanations. On the firebase sign up, is there a way to send a confirmation email to the new user instructing him to click on the email link, before allowing him access? Thx

    @skverskk@skverskk Жыл бұрын
    • You can use this method sendEmailVerification

      @0xredpill@0xredpill Жыл бұрын
  • 😍

    @yunusyas3158@yunusyas31585 ай бұрын
  • Hi bro it's nice but am applied this it is accesing by path like localhost/home without authentication

    @tech1361@tech1361 Жыл бұрын
  • but did lots of thinks eariler agt the end it throughs errors

    @sahil-ld1bu@sahil-ld1bu Жыл бұрын
  • nice video but you forgot to save user in the firestore :p

    @JJ-ot3ps@JJ-ot3ps Жыл бұрын
  • Thanks

    @Harindervir46@Harindervir462 жыл бұрын
    • Welcome!

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • Even when you're logged in and try to access home from some other place...you just can't you have to login again. It's a bug in your code.

    @Ash-uf9sn@Ash-uf9sn10 ай бұрын
  • Great content but i would like to see how you're going to store client site generated access token without storing in local storage and in Cookie.

    @rohitjha7202@rohitjha72022 жыл бұрын
    • @dipesh please enhance with it

      @jayakulhade5811@jayakulhade58112 жыл бұрын
    • I have to understand this what is the use case you are trying to achieve so that I can work on it. Usually tokens are generated from Auth server and passed to client application so that they(client app) can use the token and access the resources from resource server.

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
  • I was implementing this into one of my projects and i believe there is a bug in your code. @38:13 -- when you refresh the page, it logs the user out even tho technically the user is logged in and the UI makes it appear like the user is logged out the way u fix this is you put the 'onAuthStateChanged' function inside 'ProtectedRoute.js' AND you create a useState like so: const [user, setUser] = useState({}) onAuthStateChanged(auth, (currentUser) => { setUser(currentUser); }); just make sure you import onAuthStateChange and the 'auth' from 'UserAuthContext.js' into 'ProtectedRoute.js' the if statement should be left as is and when u refresh your authentication should persist and you should only be logged out when you click logout. hope this helps

    @westernpigeon@westernpigeon2 жыл бұрын
    • hi, can you please demonstrate with your source code?

      @ashimshrestha4004@ashimshrestha40042 жыл бұрын
    • Hi, can you help me by showing the code? I cannot seem to make it work

      @jordan0639@jordan0639 Жыл бұрын
  • Could you please provide the starting files?

    @harikrishnabomen8650@harikrishnabomen865011 ай бұрын
  • i did the same then also there is no user data in firebase

    @jayasonawa7338@jayasonawa7338 Жыл бұрын
  • Please make a video on forget password as I am new and I am not able to do it

    @tanishqmudaliar6017@tanishqmudaliar60172 жыл бұрын
  • Make video on react on AA based on token

    @surajdhungana407@surajdhungana4072 жыл бұрын
  • Sir any MERN project coming, from your side in the future videos?

    @malemyengkhom56@malemyengkhom562 жыл бұрын
    • Yes, offcourse that is in my to-do list. Appreciate to share ideas if you have any for MERN project videos.

      @DipeshMalvia@DipeshMalvia2 жыл бұрын
    • @@DipeshMalvia actually I want a video of otp verification via sms and email id too, in MERN

      @malemyengkhom56@malemyengkhom562 жыл бұрын
  • How to add the name with firebase data

    @TheBest-nq8lz@TheBest-nq8lz2 жыл бұрын
  • What if I want to add LogOut functionality in a seperate Navbar file, I tried but it gives the following Error : Uncaught TypeError: Cannot destructure property 'user' of '(0 , _context_UserAuthContext__WEBPACK_IMPORTED_MODULE_0__.useUserAuth)(...)' as it is undefined.

    @shashwatsheth9444@shashwatsheth94442 жыл бұрын
    • bhai user ko dekh auth file me same h ky or fir render shi huaa ky

      @RahulGupta-yl3jk@RahulGupta-yl3jk2 жыл бұрын
    • @@RahulGupta-yl3jk yes, but yet the same error

      @shashwatsheth9444@shashwatsheth94442 жыл бұрын
    • I had this same issue the problem is your header is most likely not in the UserAuthContextProvider go to your app.js and where your routes are make sure the header is in there. This game me so much issues for no reason.

      @1916eco@1916eco2 жыл бұрын
    • just rap the index.js with the provider, this means that the user can bot be accessible to your component

      @allymbaya2701@allymbaya2701 Жыл бұрын
  • how can we persist the user state in our app, do we need to use localstorage to do that stuff, could you plz explain in brief with reference to this code.

    @aankushchauhan@aankushchauhan Жыл бұрын
    • @Samuel lebaron yeah, I find the fix instead of setting the value of user to "" in the useState make it an object. {} ex - const [user, setUser] = useState({}); works for me!

      @aankushchauhan@aankushchauhan Жыл бұрын
  • hi thanks for this video but i am having an error from the login file: Uncaught TypeError: Cannot destructure property 'logIn' of '(0 , _context_UserAuthContext__WEBPACK_IMPORTED_MODULE_2__.useUserAuth)(...)' as it is undefined. at Login (Login.js:12:1)

    @thepatternhub853@thepatternhub8532 жыл бұрын
    • rap with the userAuthProvider to the index.js

      @allymbaya2701@allymbaya2701 Жыл бұрын
  • I am getting error googlsignIn is not a function

    @ashharmansuri6816@ashharmansuri6816 Жыл бұрын
KZhead