How To Set Up React With Firebase/Firestore | Get & Realtime | Part 1

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ก.พ. 2025

ความคิดเห็น • 80

  • @SamFromaway
    @SamFromaway  2 ปีที่แล้ว

    NEW VIDEO Version 9: th-cam.com/video/-yrnWnN0g9o/w-d-xo.html 👈

  • @opus1magnum
    @opus1magnum 2 ปีที่แล้ว +4

    Thanks for video!
    Btw, whoever got an error after trying to import from 'firebase/app' - just letting you know that imports now (from v9 of firebase) must be made from 'firebase/compat/app'.
    Like this - import firebase from 'firebase/compat/app';

    • @loxx8782
      @loxx8782 2 ปีที่แล้ว

      Maan i love you, I've been thinking what's wrong for almost and hour..

    • @opus1magnum
      @opus1magnum 2 ปีที่แล้ว

      @@loxx8782 happy this saved your time! :)

  • @trevorallen7554
    @trevorallen7554 3 ปีที่แล้ว +5

    Thank you Thank you! This is by far the easiest and simplest React-Firebase tutorial on TH-cam. Perfect!

  • @yusufdimari3512
    @yusufdimari3512 3 ปีที่แล้ว +4

    This is the simplest tutorial ive seen and the best as well.
    Thank you very much.

  • @sohamjain7803
    @sohamjain7803 2 ปีที่แล้ว +1

    thank you so much, its a bit out of date with v9 requiring slightly different imports but the way you walked through how to do everything was so easy to understand.

  • @hassaneloufir8440
    @hassaneloufir8440 4 ปีที่แล้ว +2

    thank you sooooooooo much this is what I was looking for. this video deserves more likes :3

  • @AkashSatre
    @AkashSatre 2 ปีที่แล้ว

    Thanks bro your video helped me Alot in a task where I was stuck from too long

  • @pjguitar15
    @pjguitar15 4 ปีที่แล้ว +2

    This tutorial is so simple and short, I like it

  • @mahedikamal8472
    @mahedikamal8472 4 ปีที่แล้ว +1

    thanks , it helped me to add firebase 1 day before my project submission .

  • @laurentgenereux4159
    @laurentgenereux4159 3 ปีที่แล้ว

    Omg !!! Thank you !!! I'm struggleling for a looooooooong time with this !

  • @allansaleh6267
    @allansaleh6267 4 ปีที่แล้ว +1

    Awesome tutorial! Well explained! You deserve more subscribers!

  • @muhammadosama4593
    @muhammadosama4593 3 ปีที่แล้ว

    I was facing some error when I connected firebase with my react app. But after thi video I have solved the problem.
    Thank You and God bless you

  • @dattubhargavmedarametla576
    @dattubhargavmedarametla576 4 ปีที่แล้ว

    You deserve a like and comment dude. Thanks for the video

    • @SamFromaway
      @SamFromaway  4 ปีที่แล้ว

      I appreciate that :D

  • @stelladare5741
    @stelladare5741 3 ปีที่แล้ว

    This turtorial was really helpful and straignt to the point. Thanks a lot.

  • @bharatigogoi2779
    @bharatigogoi2779 3 ปีที่แล้ว

    Thank You So much!!! I've been looking for this since a long time. You really saved me!! Thank You :D

  • @kalpeshpatil741
    @kalpeshpatil741 3 ปีที่แล้ว +3

    this is the content i am looking for

  • @ade-joshe
    @ade-joshe 3 ปีที่แล้ว

    Thanks... It was quite easy to follow and understand

  • @chiranjeevichowdary5948
    @chiranjeevichowdary5948 3 ปีที่แล้ว

    Very nice video.U r helping us a lot!!

  • @antoniobraccio5210
    @antoniobraccio5210 3 ปีที่แล้ว +1

    i have this problem :
    index.js:1 [2021-03-21T13:25:22.609Z] @firebase/firestore: Firestore (8.3.1): Could not reach Cloud Firestore backend. Connection failed 1 times.

  • @estebanmunchjones7946
    @estebanmunchjones7946 4 ปีที่แล้ว +1

    thanks bro! I was struggling adding the SDK and initialising Firebase

  • @santacroce2489
    @santacroce2489 3 ปีที่แล้ว +1

    you saved my life . perfect tutorial

  • @dbsjaks_56888
    @dbsjaks_56888 3 ปีที่แล้ว

    what i was looking for! thanks

  • @Yosk-p8j
    @Yosk-p8j 4 ปีที่แล้ว +1

    Wow amazing. Well done. Thank you

  • @mahanmashoof1989
    @mahanmashoof1989 3 ปีที่แล้ว +4

    Thanks for this nice tutorial! Firebase v9 should import like firebase/compat/your_package instaed of just firebase/your_pacakge

  • @pauljohny200
    @pauljohny200 4 ปีที่แล้ว

    I needed to understand this. .You have put the right video in right time .Thanks The other good news is you have put the code in github

    • @SamFromaway
      @SamFromaway  4 ปีที่แล้ว +1

      Glad you liked it 😁

    • @pauljohny200
      @pauljohny200 4 ปีที่แล้ว

      @@SamFromaway Yes it is super.. Thanks again..alsoo thanks for part 2.

  • @jaggyjut
    @jaggyjut 3 ปีที่แล้ว +1

    what if we also want to upload the picture of the school in firebase storage and also be able to perform CRUD operations on the image.

  • @kennygunderman
    @kennygunderman 4 ปีที่แล้ว

    Thank you!

  • @brittosmonteiro
    @brittosmonteiro 3 ปีที่แล้ว

    This helped me a lot!
    Thank you!

  • @tronganhnguyenthanh1157
    @tronganhnguyenthanh1157 3 ปีที่แล้ว

    Do we have any ways to add another field directly in database that we create ?

  • @arsenemn
    @arsenemn 4 ปีที่แล้ว

    Thanks a lot u really helped me🙏

  • @showbikshowmma3520
    @showbikshowmma3520 3 ปีที่แล้ว

    one big question how did u change all those stuff in one click 11:31 how did u changed all app keys to for example apiKey: process.env.REACT_APP_API_KEY, how!!?

    • @finne.7726
      @finne.7726 3 ปีที่แล้ว

      He created the file before

    • @showbikshowmma3520
      @showbikshowmma3520 3 ปีที่แล้ว

      @@finne.7726 how and also how can i do that

  • @evernolasco19
    @evernolasco19 3 ปีที่แล้ว

    Thank you so much!!!! This is exactly what I was looking for!!! How can I upload to the database from react using a state

  • @sushantkamble736
    @sushantkamble736 3 ปีที่แล้ว

    Thanks! very helpful

  • @probro8747
    @probro8747 2 ปีที่แล้ว

    thank you soo much!

  • @wildrap9804
    @wildrap9804 4 ปีที่แล้ว +4

    There are many errors in the setup:
    1. If statement before the use effect
    2. Expected an assignment or function call and instead saw an expression
    3. Firebase does not work
    4. getMember Data does not work either...

  • @xplore2000
    @xplore2000 3 ปีที่แล้ว

    Hello there sir I really like the way you are explaining to us
    I don't know if you know Shaun for the net ninja channel?
    You're nice in explanation like Shaun man.
    Thanks for making me understand how to work with react hooks and firebase ✌🏿✌🏿

    • @SamFromaway
      @SamFromaway  3 ปีที่แล้ว +1

      Thanks that's a real compliment :D

    • @xplore2000
      @xplore2000 3 ปีที่แล้ว

      @@SamFromaway I got some issues while running my website thesame procedures you did I also did but I just get an error

  • @TheNamesJT
    @TheNamesJT 3 ปีที่แล้ว

    So what does someone do if they already coded a rest api locally with express and using fake data as a json file in my project. I'm wanting to host my backend on firebase the api and database would this series be right for me?

  • @svorskemattias
    @svorskemattias 3 ปีที่แล้ว +1

    How does putting the keys in an env-file protect them? The keys are still being loaded into the browser aren't they?

    • @SamFromaway
      @SamFromaway  3 ปีที่แล้ว +1

      You are correct, it's just one of many things to protect the database. The .env is primarily a good practice, because sometimes there are server side keys that are not exposed. How to protect the database when you have client side keys is with security rules. More about that here: th-cam.com/video/hQI_w4AZ92I/w-d-xo.html

  • @timzeynalov3537
    @timzeynalov3537 3 ปีที่แล้ว

    I cant understnund but why do we need to use setLoading true and false when we try to take data from document and use it ?

    • @SamFromaway
      @SamFromaway  3 ปีที่แล้ว

      Because first we are setting loading to true, so the loading text shows, then we start the asynchronous action to try getting the date, once we habe the data we set loading to false so the loading text dissapears.

  • @p0mf47
    @p0mf47 3 ปีที่แล้ว

    what version firebase is this

  • @michaelantoniobutler3846
    @michaelantoniobutler3846 2 ปีที่แล้ว

    Is the .env file required?

  • @binaystha1813
    @binaystha1813 4 ปีที่แล้ว

    Great video!!!!

  • @mbogomahad3125
    @mbogomahad3125 4 ปีที่แล้ว

    it helped for real.

  • @lardosian
    @lardosian 4 ปีที่แล้ว

    So I assume the realtime function is using graphq, subscriptions and websockets in the background to update in realtime. Personally I'm using aws amplify framework and DataStore to do similar. DataStore is an offline first approach where the user interacts with a local browser indexdb which syncs with the cloud dynamodb.

    • @rgb2647
      @rgb2647 2 ปีที่แล้ว

      yes no one can tell you what happens when you refresh de page 200 times, how to handle unsubscribe etc.

  • @maratfaizer
    @maratfaizer 3 ปีที่แล้ว

    awesome !

  • @eduardoayora2327
    @eduardoayora2327 4 ปีที่แล้ว

    Gracias, muy buen video

  • @mrdeangray
    @mrdeangray 4 ปีที่แล้ว

    Thank you, thank you, thank you!!!!

  • @INFLUENCERPOINTSS
    @INFLUENCERPOINTSS 4 ปีที่แล้ว

    cant find firebase js in my files

  • @perynal
    @perynal 3 ปีที่แล้ว

    So what if each school had a collection named 'students'. Each with their name and favorite subject. How would you display that?

    • @SamFromaway
      @SamFromaway  3 ปีที่แล้ว

      You probably mean how to structure the database for that? Then you have a so called one (school) to many (students) relationship. As with Firebase you are not able to really do "relationships" with your different collections, you have those options.
      1. Put a student's set (array) in each school document itself.
      If for some reason you want it in a separate collection you'll do:
      2 a). Reference a id-set (array) in each school document.
      2 b). You reference the school in each student document itself.
      With 2 and 3 you just need to make sure to keep the id-set in schools and the students collection in sync as Firebase won't take care of that like a relational database.

  • @maiaklimenko6614
    @maiaklimenko6614 3 ปีที่แล้ว

    The setup looks so easy, but, no matter what I do, it always returns empty data. The collection has items and the names are correct, but data is never there :(

  • @Farhaan-td3dk
    @Farhaan-td3dk 3 ปีที่แล้ว

    For anyone getting error TypeError: Assignment to constant variable.
    Use:
    var [loading, setLoading] = useState(false);
    instead of:
    const [loading, setLoading] = useState(false);

    • @SamFromaway
      @SamFromaway  3 ปีที่แล้ว

      Thanks for the idea. Bit you shouldn't reassign react state. Use immutable programming. So if you want to change state use `setLoading(newState)`. Also, in modern javascript we only use const or if we reasign a value, we use let. I hope it helps.

    • @Farhaan-td3dk
      @Farhaan-td3dk 3 ปีที่แล้ว

      @@SamFromaway I am new to JS and React, thanks for the info 😁

  • @seaNxgil
    @seaNxgil 3 ปีที่แล้ว

    i luv u ty

  • @sealovingsoura3036
    @sealovingsoura3036 3 ปีที่แล้ว

    My data is not coming ,but I am getting no error

  • @chanmyaemaung
    @chanmyaemaung 4 ปีที่แล้ว

    Why you're not using Realtime database instead of using firestore?

    • @SamFromaway
      @SamFromaway  4 ปีที่แล้ว

      It has some more features than the real time database and nowadays should be the default choice unless you need a specific feature that only the real time database has.

    • @chanmyaemaung
      @chanmyaemaung 4 ปีที่แล้ว

      @@SamFromaway Thank you for your explanation.

    • @chanmyaemaung
      @chanmyaemaung 4 ปีที่แล้ว

      @@SamFromaway How do I have to retrieve the single objects data without looping through and put it to the useState hook, that I have stored only one single objects in the firestore?
      I have subscribed your Channel because I love your teaching style and it is quite a bit easy to understand for me.

  • @yogeshrajput5712
    @yogeshrajput5712 3 ปีที่แล้ว

    Not working 😭

  • @the_seg_faulter
    @the_seg_faulter 3 ปีที่แล้ว

    Trash tut.