React Firebase Authentication Tutorial | Firebase 9 Tutorial

Sdílet
Vložit
  • čas přidán 17. 10. 2021
  • Hey guys in this video I will be showing how to create an authentication system in a react application!
    Code: github.com/machadop1407/react...
    🚀 Learn ReactJS By Building 6 Projects: codedamn.com/learn/reactjs-pr...
    -
    Social
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Website: machadopedro.com
    Linkedin: / machadop1407
    Instagram: / _pedro.machado_
    Github: github.com/machadop1407
    Email: machadop1407@gmail.com
    Tags:
    - ReactJS Tutorial
    - ReactJS and MySQL
    - NodeJS Tutorial
    - API Tutorial
    #firebase #react
  • Věda a technologie

Komentáře • 318

  • @loganbruesehoff3798
    @loganbruesehoff3798 Před 2 lety +80

    If you are having the problem where the app freezes or if VS Code doesn't like the "user?.email" the solution is to put the onAuthStateChanged into a useEffect.
    useEffect(() => {
    onAuthStateChanged(auth, (currentUser) => {
    setUser(currentUser);
    });
    }, [])
    user?.email can be turned into:
    {user ? user.email : "Not Logged In"}

    • @sidhantkumar152
      @sidhantkumar152 Před 2 lety

      can you share the entire snippet please i am having trouble implementing this

    • @Adam-bj5vx
      @Adam-bj5vx Před 2 lety +1

      so funny, i just solved this problem after a few minutes of thinking and came here to post this solution but you got to it before I did. Nice job, and thanks for sharing!

    • @riskeydemon2171
      @riskeydemon2171 Před 2 lety

      MASHALLAH BRO THAHK U VERY MUCH

    • @paulinemomanyi6787
      @paulinemomanyi6787 Před 2 lety +1

      I spent the last 10 hrs troubleshooting this error until I came across this comment. Lots of love from an African girl who wanna be a badass dev just like you. Thanks.

    • @clementciron4522
      @clementciron4522 Před 2 lety

      Thank you so much

  • @alejo_420
    @alejo_420 Před 2 lety +2

    this is definitely the best tutorial I've seen, thanks for going over the small details and "beginner" stuff. lots of people skip over it and it leaves room for misunderstandings and errors.

  • @samsonbrody6308
    @samsonbrody6308 Před 2 lety +57

    I gotta say man, I love these firebase/react combo videos. you explain things better than anyone i have found yet. I think some tutorials jump ahead and just assume immediate understanding, whereas you carefully walk through each step. foundations are everything in coding

    • @PedroTechnologies
      @PedroTechnologies  Před 2 lety +3

      I appreciate that! I remember when I was learning every technology that I teach now and I always struggled with this same problem.

    • @unknownguy2905
      @unknownguy2905 Před 2 lety

      @@PedroTechnologies At what age did you start learning programming? you are like 20-21, 5 years younger than me and know 10x more, congrats, btw Ive checked all other firebase vids and you man make them the best out of them all, thank you for that and keep making more firebase vids

    • @michaelhorvilleur8898
      @michaelhorvilleur8898 Před rokem

      faaaaaaacts!

    • @asifarpk
      @asifarpk Před rokem

      @SamsonBrody I agree with you. I was here to say this, but you already have said. Thanks PedroTech. :)

  • @nrwl23
    @nrwl23 Před 2 lety +18

    Wanted to mention that the onAuthStateChanged() function needs to be called only once in react 18 and FB9 (not sure other versions). Putting it into useEffect seemed to fix it and it works perfectly. Great video!

  • @allanina
    @allanina Před 2 lety +4

    Pedro, muito obrigada por esse vídeo. Os conteúdos do seu canal sempre me ajudam bastante, você tem uma didática excelente e sempre parece que lê a minha mente quando eu estou presa com alguma coisa kkkkkkk valeu mesmo!

  • @user-um1yr7lg2m
    @user-um1yr7lg2m Před 2 lety +1

    I've just want to learn Firebase with React. I have been watching a lot videos but your tutorials are very clean and easy by explaining each step in your code and not just jumping around. Thanks you're very very good.

  • @royhyde8842
    @royhyde8842 Před 2 lety +13

    Thank you very much for your videos, they are simple, detailed, very clear, well explained, and straight to the point. In my opinion, they are the best Firebase tutorials I have seen so far, and to be honest, I have seen quite afew.

  • @cientifica9150
    @cientifica9150 Před rokem

    I needed someone who could just focus on functionality and explained all the concepts right away... you're amazing bro! Keep going!

  • @scarsofadown
    @scarsofadown Před 2 lety

    Que isso cara, material excelente!
    Estou indicando seu canal pra todos que eu conheço que estão começando.
    Obrigado pelo conteudo

  • @emmayen2145
    @emmayen2145 Před 2 lety +1

    Wow. the moment I had to use firebase auth in my project and I had trouble cause all the other videos were "outdated". bless your soul

  • @tadakuniyasuda8214
    @tadakuniyasuda8214 Před rokem +1

    This tutorial is the first time I got through with firebase because other bigname youtuber's tutorials are outdated !!!!! THANK YOU THANK YOU THANK YOU

  • @linyerin
    @linyerin Před 2 lety

    Greate tutorial, thank you man. Your tutorial touches on the really basic concepts that I am looking for and is really helpful. Some other videos spend a lot of time customizing the styles, buttons, colors, etc. Who care how they style the page? That was totally a waste of time. Yours is different. Very clear and concise. I love it.

  • @mikeburgess8294
    @mikeburgess8294 Před 10 měsíci

    Hands down the most straight forward and easy to understand tutorial on this subject. Thanks so Much!

  • @pratibhapradhan1685
    @pratibhapradhan1685 Před rokem

    I have been looking for a video that could explain this exact combination for soooo long, Tried watching a few other videos but they are nothing with comparison to this one. I have to say this, you are a great GURU. Thanks

  • @abelmurua6980
    @abelmurua6980 Před 2 lety +2

    Just what I needed and you uploaded just now. Thank you!. Easier to persist the instance... If you have more on firebase that would be great... following and subscribed

  • @thecodingloft
    @thecodingloft Před rokem

    Really love your tutorials. You have a very clear and easily understandable way of explaining the workings in your code. Thank you!

  • @user-my2ps2uv7u
    @user-my2ps2uv7u Před 11 měsíci

    I have watched many vedios on firebase, but majority people focus more on CSS and come to point later on .This is the perfect one that I was looking for

  • @00xfitx2
    @00xfitx2 Před 2 lety

    Thanks bro! It helped a lot, I'm also brazilian and so proud that we have people like u here.
    TAMO JUNTO CARAI

  • @matissjudins6272
    @matissjudins6272 Před rokem +1

    so good man, i learnt Firebase crud, routing, auth and firestore in 2 days from your videos. thank you

  • @bogdanmilivojevic9619

    Hey Pedro, this was very helpful. You provided a great and simple lesson on Firebase authentication which can be understood by anyone. Thanks a lot ! Keep up the good work

  • @michaelhuskey2608
    @michaelhuskey2608 Před rokem

    Great video! Really like how you are able to use the basic React concepts and Firebase without mixing in CSS & Styling which is its own domain

  • @raso1384
    @raso1384 Před 6 měsíci

    Thank you so much for the tutorial!!! I was struggling with MySQL deployment and I found Firebase is much easier for me to start with as a beginner:)

  • @lucaslorenzo6249
    @lucaslorenzo6249 Před rokem

    best firebase authentication tutorial i had ever seen, excellent information and the way you explain it its just flawless, keep it going

  • @haloandfable
    @haloandfable Před 2 lety +1

    When im stuck on something while creating a website I look for your videos because you explain concepts very well. Thank you for all the content.

  • @stephanpaul8954
    @stephanpaul8954 Před rokem

    You're always a rockstar Pedro, Never messed around with firebase or supabase... been wanting to make a little app for a while but was dreading the authentication... someone on my team said "just use firebase, it does it for you"... I had no idea 😂😂 you saved my life!

  • @Huntabyte
    @Huntabyte Před 2 lety

    Incredibly explained. Your videos are fantastic and have given me a much better understanding, thank you.

  • @H2O-OW
    @H2O-OW Před 2 lety +1

    This is a great video thanks for making it, please do more React + Firebase projects. And good luck with your classes!

  • @ayoubnachat5920
    @ayoubnachat5920 Před 2 lety

    this was a good explained tutorial just like your other tutorials, thank you so much!!

  • @carl5017
    @carl5017 Před rokem

    Your videos are amazing, and a big help for junior React devs. Thanks

  • @paulinemomanyi6787
    @paulinemomanyi6787 Před 2 lety

    I should have come across this channel when I was 2 years old. So much wisdom in here

  • @deniskimani421
    @deniskimani421 Před 2 lety +2

    Just what i needed. Thanks Pedro

  • @dmytronice1337
    @dmytronice1337 Před 2 lety

    Hello Pedro, right now I am doing the test project for getting my first job as a front-end developer, and your video is really helpful. Your video kinda fresh video about firebase, but some syntax already has changed! lol

  • @tomasalves4958
    @tomasalves4958 Před rokem

    Pedro, I love your videos. Keep the great job, mate!

  • @aliwarraich5067
    @aliwarraich5067 Před rokem

    Clear, consize, to the point. Thanks man!

  • @MrProTutos
    @MrProTutos Před 2 lety

    Thank you so much Pedro, This tutorial was very helpful! Keep it up! 🚀🚀

  • @zeroj7492
    @zeroj7492 Před 2 lety +2

    short, concise and nice tutorial. Thanks a lot pedro

  • @vanehsann
    @vanehsann Před 6 měsíci

    I saw a lot of videos, but nothing compares to yours.. Thank you

  • @feechuong
    @feechuong Před 2 lety +10

    If anyone has the freezing problem when typing in the input, please use `onAuthStateChanged` inside a useEffect with an empty array.... anyway, someone has solved it first :D

    • @chrisxiang
      @chrisxiang Před rokem +2

      Change to useEffect(()=>onAuthStateChanged(auth,(currentUser)=>{setUser(currentUser);})},[ ])

  • @helloworld2740
    @helloworld2740 Před 2 lety

    Thank you very Much I have watched many tutorial but none of them have Teached This much

  • @valcaro87
    @valcaro87 Před 2 lety

    i followed your tutorial and it works smoothly! thank you!

  • @lynx3866
    @lynx3866 Před 10 měsíci

    thanks, I love firebase/react combo, but after 1 year not use it, I confused. Your video really help and your explanation is awesome

  • @sekarsalsabilasp1864
    @sekarsalsabilasp1864 Před rokem

    thank u so much! i have an assignment and this really helps me. Also you explained the course so good

  • @MZ-yx8eg
    @MZ-yx8eg Před 2 lety

    it clicked after your clear video nice job man!

  • @TutorXplore
    @TutorXplore Před 3 měsíci

    You make authentication set up so easy, thank you!

  • @josuepintor9315
    @josuepintor9315 Před 2 lety

    This was fantastic and easy to follow, thanks!

  • @donejust2728
    @donejust2728 Před rokem

    first time i come here, but i feeling great. thanks for this thing man

  • @shanarussell1254
    @shanarussell1254 Před rokem

    Excellent explanation. I'm off to try it now. Thank you!

  • @ashokchhetri8513
    @ashokchhetri8513 Před 2 lety

    Thank you for these amazing tutorials 🙏🏼🙏🏼

  • @seandorr8133
    @seandorr8133 Před rokem +4

    Really helpful tutorial! I did have some problems with the app being unresponsive after adding the onAuthStateChanged function - putting this inside a useEffect solved this for me

    • @codewithdevhindi9937
      @codewithdevhindi9937 Před rokem +1

      You my freind are a LEGENDARY programmer i was finding THIS solution for 2 days and FINALLY found it it's so relieving awsome 🚀🚀🚀🚀🚀🚀🚀🚀🔥🔥🔥🔥🔥🔥

    • @seandorr8133
      @seandorr8133 Před rokem

      @@codewithdevhindi9937 Glad I could help! ;)

    • @GauravRai
      @GauravRai Před 9 měsíci

      @@seandorr8133 useEffect with empty dependency array ?

  • @sushantharne9342
    @sushantharne9342 Před rokem

    You r really great bro👍👍👍. The way u clear the concepts is really great. Your videos helped me lot. Thanks...

  • @totochriss
    @totochriss Před rokem

    Thank you very much for your tutorials they are perfect even for a Frenchman!

  • @wealthiduwe5831
    @wealthiduwe5831 Před 2 lety

    Great content and well detailed... I will always recommend this

  • @dionardomarques18
    @dionardomarques18 Před 2 lety

    Amazing stuff bro! Regards from Brazil :)

  • @fidashnakher8942
    @fidashnakher8942 Před 2 lety +1

    thank you so much, helpful, simple & time saving. :)

  • @rafaeljordao_
    @rafaeljordao_ Před 2 lety

    Parabéns pelo vídeo, muito claro e preciso!

  • @julianocorrealo9035
    @julianocorrealo9035 Před 2 lety

    thank you man for this tutorial, this video helped me a lot!

  • @patitorodri
    @patitorodri Před 2 lety

    awersome, pedro!!! thank you !!!

  • @makemoneytvlusaka604
    @makemoneytvlusaka604 Před 2 lety

    Awesome! This you have done perfect! my Guy!

  • @codedaddy1646
    @codedaddy1646 Před 2 lety

    Thank you for this video. Great stuff!

  • @jestinabraham5626
    @jestinabraham5626 Před 2 lety

    Thank you was searching for it !!

  • @akiij
    @akiij Před 2 lety +9

    not sure if you've covered redux persist before but since most of auth on react requires you to store the user data on local storage & fetch it on mount, I would love to see you do a video on redux persist too! I'm working on firebase redux-toolkit but idk how to use redux persist or even create asyncThunk :3. Kind of a selfish request but if a lot of ppl want to see the same in future maybe you could make a video on it! thanks again for all the awesome content!

    • @Jb67912
      @Jb67912 Před 2 lety

      The use of Context on Web Dev Simplied tutorial for firebase and react might be helpful. I came from there because he did the auth initialization importing slightly the old way. czcams.com/video/PKwu15ldZ7k/video.html

    • @akiij
      @akiij Před 2 lety

      @@Jb67912 I learnt redux toolkit last month 😁 it's pretty sick and persist is a fix for not losing auth data or any data on page refresh unless you pass that reducer state in blacklist. Context is not much of use if you're using redux I believe, maybe I'm wrong. I haven't needed to use context since state is global in store. As for auth I used the firebase method of Andrei from ZTM. It's a paid course but I was learning react/redux so it's done now. Thanks for sharing resources, really appreciate it.

  • @spikycoders
    @spikycoders Před 2 lety

    The Best one 😍 i have ever seen!

  • @ayushranjan3002
    @ayushranjan3002 Před 2 lety +3

    Thank you so much for this wonderful tutorial...Could you make a video on how to use realtime database in firebase:)

  • @tabmax22
    @tabmax22 Před rokem +2

    just one little pointer, you don't need to use useState to get the values of the email and password input fields, you should just use useRef variables

  • @Jb67912
    @Jb67912 Před 2 lety

    Thanks, needed to see an updated 2021 example

  • @baotruong5775
    @baotruong5775 Před rokem

    Amazing good job! Thank you from bottom of my heart

  • @duchailu
    @duchailu Před 2 lety

    NICE VIDEO ! seriously, very simple, you don't waste time on css or other "useless stuff" going right to the real topic (not saying css is useless, just that in these type of video, it's not what we're looking for)

  • @praveennair2119
    @praveennair2119 Před rokem

    I was searching for this video. Let me implement in my project 😍🥰😘

  • @fn8629
    @fn8629 Před rokem

    this is great! thanks for the content bro

  • @yasinnkhann
    @yasinnkhann Před 2 lety +1

    Ótimo vídeo Pedro!

  • @luzcarimelucumihernandez2155

    Thank you! your video was really useful to me ^^

  • @DeepakKumar-ss2ql
    @DeepakKumar-ss2ql Před rokem

    just amazing.....saved a lot of my time. Bless u.

  • @Shabalinmax
    @Shabalinmax Před rokem

    Thanks for tutorial! :) finally I got it😅

  • @velhoguidsd
    @velhoguidsd Před 2 lety +2

    Se preocupa mais em mostrar o conteúdo de forma direta, do que com firulas como CSS.
    PERFECT!

  • @kumarrahul2176
    @kumarrahul2176 Před 2 lety

    thanks dude! it was really helpful

  • @TrackingAcademy
    @TrackingAcademy Před 2 lety

    Worked like a charm, thanks

  • @samaypatel9684
    @samaypatel9684 Před 2 lety

    Very good explanation I loved it

  • @s.y1101
    @s.y1101 Před 2 lety

    Thank you man you helped a lot!

  • @codewithdevhindi9937
    @codewithdevhindi9937 Před rokem +1

    LEGENDARY video

  • @alanhernandez4397
    @alanhernandez4397 Před 2 lety

    Bro, thank you too much, i was trying to make the auth, but the courses that I saw doesn't work, you help me a lot, I'm meaking a web app for a project of my school. New suscriber
    PS: Sorry if I have a bad english, I'm from México and I'm trying to speak English

  • @dymonn
    @dymonn Před rokem

    Bro, AMAZIN video!!! hours searchin for a simple tutorial for signup and login with React an Fb,
    U THE BEST HOMIE!!!

    • @dymonn
      @dymonn Před rokem

      Liked and subd!!

  • @totochriss
    @totochriss Před rokem

    merci beaucoup pour vos tutoriels ils sont parfaits même pour un Français !

  • @freddyrenecariasvasquez9843

    I added the useEffect thus avoiding the infinite update cycle:
    useEffect(() => {
    const unsubscribe = onAuthStateChanged(auth, (currentUser) => {
    setUser(currentUser);
    });
    return () => unsubscribe();
    }, []);
    thanks for the video it helped me a lot .

    • @iStinq
      @iStinq Před 4 měsíci

      Thank you !

    • @iStinq
      @iStinq Před 4 měsíci

      Thank you !

  • @brohjoe
    @brohjoe Před 2 lety +1

    Thanks for a great clearly explained video. You are a great instructor. Like another person said, you explain the details that others gloss over which can make the difference between success and failure. Thanks a million. By the way, as others have suggested, how about a video on the Firestore database?

    • @itsgox
      @itsgox Před rokem

      He did, it's the first tutorial on the firebase playlist

  • @mustaneerhaider515
    @mustaneerhaider515 Před 2 lety +10

    Thanks for this.. it would be great if you make a vid on img upload to firebase storage

  • @vineethkumar8132
    @vineethkumar8132 Před 2 lety

    Thank you so much, this was lit!!!!

  • @SvetaSveta-ms4hi
    @SvetaSveta-ms4hi Před 2 lety

    Thanks a bunch, Pedro! ❤️
    Do you have a Next.js tutorial?

  • @lchampzzz
    @lchampzzz Před 2 lety

    thanks for the lesson, man!

  • @UrbanNerdOfficial
    @UrbanNerdOfficial Před rokem

    Great tutorial!

  • @calebrcannon
    @calebrcannon Před 2 lety +1

    This is SICK. Thank you!

  • @andresdosantos5310
    @andresdosantos5310 Před rokem

    Good class, excellent work

  • @godnessy
    @godnessy Před 2 lety

    Great video! thanks!
    I think you meant to say something about an issue in the last part of the video but then you might have forgotten about it when the issue with the 6 characters for the password came up?

  • @aliscripts5314
    @aliscripts5314 Před 2 lety +1

    I like your Videos bro they help me very well

  • @prateektiwari4116
    @prateektiwari4116 Před 2 lety +2

    Trust me you teach much much much much muchh better than my college professors.... LOVE FROM INDIA❤️

  • @kamrangondal9009
    @kamrangondal9009 Před 2 lety

    thanks dear for such a helpful content.

  • @sarawaqar1561
    @sarawaqar1561 Před rokem

    Nicely Explained :)

  • @harshpatel1971
    @harshpatel1971 Před 2 lety

    Thanks it helps me a lot🤗

  • @souhaib1902
    @souhaib1902 Před 2 lety

    Thank You So Much It helps me alot

  • @adarshchakraborty8555
    @adarshchakraborty8555 Před 2 lety

    Thanks, This is helpful!

  • @pupstardao_
    @pupstardao_ Před rokem

    Finally i got it❤👍