Context API Tutorial For Beginners - Using React Hooks

Поділитися
Вставка
  • Опубліковано 12 гру 2024

КОМЕНТАРІ • 295

  • @abhcode
    @abhcode 3 місяці тому +6

    On point thanks man!!
    To sum up :
    1. create a context.js for a particular group of children who want to access (or share) same states
    2. import that context in parent of those grouped components (by grouped components i mean the children who are going to share same states without "prop digging")
    3. provide values for that context which can be accessed by the children
    4. To access in children destructure the object passed in provider and use useContext(contextName) to get the object passed in the provider
    whoooo this ends the summary that i have learnt from this video!!😊

  • @stackercoding2054
    @stackercoding2054 3 роки тому +75

    Thanks for creating this video straight to the point, I was able to implement context in my project in just a few minutes.

  • @frogonajetski
    @frogonajetski 2 роки тому +56

    This is absolutely, beyond a shadow of a doubt, the best explanation of this on UA-cam.
    Thank you for helping me understand it completely in 10 minutes.

  • @naspy971
    @naspy971 3 роки тому +3

    I struggled so much to find someone explaining it with another example than just the theme example, and very clearly.. THANKS DUDE !!

    • @VP-qd2ed
      @VP-qd2ed 7 місяців тому

      damn mee too cant understand the white boys shit

  • @emegwaonyeka7132
    @emegwaonyeka7132 Рік тому +6

    For once I finally understood and implemented context API...you explain so easily and straight to the point, with points to take. Thank you

  • @pauloricardomaltaleal3558
    @pauloricardomaltaleal3558 Рік тому

    Every day you help me in different way, I recived my first task in my job that need to use context, im search in ytb, watch your video, and now I can continuous my task.

  • @deveshb793
    @deveshb793 2 роки тому

    Mann you're the best, you don't kow how much I've grown watching your tutorials

  • @shubhamrathod5933
    @shubhamrathod5933 Рік тому

    I saw many tutorials for useContext, but after this tutorial, I understood how to use context API easily. Thank you :)

  • @adarshnayak6803
    @adarshnayak6803 3 роки тому +1

    I do not know why you are so underrated , You content is amazing , to the point like it should be

  • @lngwnd1
    @lngwnd1 3 роки тому +1

    The fact that you left no comment unanswered made me subscribe. Thanks for making this very simple and digestible KT video.

    • @PedroTechnologies
      @PedroTechnologies  3 роки тому

      Thanks for the sub! Sometimes I get caught up with work and am unable to answer some, glad on this one I was able to answer everyone hahaha

  • @apawar3099
    @apawar3099 3 роки тому +11

    Thanks "SIR", This was the best explanation I found after searching all day....Thank you so much Pedro❤️

  • @triumphanazia4654
    @triumphanazia4654 6 місяців тому

    This is the best explanation on context api so far. Short, Simple, with application. Super helpful ❤

  • @yogi2983
    @yogi2983 2 роки тому

    This is the best explanation I've seen yet. I've struggled to understand how to use this until now. Thanks!

  • @johnnash6078
    @johnnash6078 2 роки тому +1

    Another wonderful video..just to the point..no nonsense blabla! Really appreciated!

  • @maxmaksum4673
    @maxmaksum4673 3 роки тому +1

    brother, I have watch many tutorials on usecontext api. But this one your tutorial is so simple and short. and I get it. thank you

  • @zaintahir3348
    @zaintahir3348 Рік тому +1

    best explanation , simplest , clearest, absolutely best. Thank you so much !

  • @AdamElMou
    @AdamElMou 3 роки тому +2

    you just saved me 1 hour of my life in 10minutes

  • @kushalmondal618
    @kushalmondal618 Рік тому

    What a level of making someone understand topic of fear...... it was smooth by you.... thank you....

  • @andrewleonardi3351
    @andrewleonardi3351 Рік тому

    Far and away the best video explaining the Context API.

  • @fakedofaker9878
    @fakedofaker9878 9 місяців тому

    its cool that i knew u were brazilian too by hearing your accent. Good work, man. Proud of your content

  • @Subhan-Qamar
    @Subhan-Qamar Рік тому

    Elaborated professionally and increased the understandability.Thanks brother

  • @mennamagdy7783
    @mennamagdy7783 3 роки тому +3

    Thank you a lot! A great tutorial, straight to the point, and easy to understand. I admire your simple way of explaining it. I always find it difficult to understand it.

  • @toughguy9613
    @toughguy9613 2 роки тому +1

    I got my job watching your tutorials ❤️ Thanks bro

  • @DHKarol
    @DHKarol Рік тому

    I don't know why but you seem like the only guy that translates the problems new things to me as I would expect it to be done. The logic is nicely and simply explained unlike in other videos where it seems like they took some random lines from google trying to explain the feature

  • @danieljohnson4597
    @danieljohnson4597 Рік тому

    Thanks after multiple tutorials, i finally understand

  • @canaleduardokuhn
    @canaleduardokuhn 3 роки тому +1

    Your videos are not only extremely helpful but also very inspiring to us brazilians as you might imagine. I'm glad to discover this channel! Valeus! =)

  • @youtubefornothing
    @youtubefornothing 6 місяців тому

    finally i got the concept of use context , thanks for explaining that easily.

  • @aidanasal3935
    @aidanasal3935 3 роки тому +4

    Great tutorial! Getting straight to the point was super helpful in understanding it better and easier.

  • @bernard2560
    @bernard2560 Рік тому

    Finally I understand the context API, thank you!!!

  • @lilwayne6037
    @lilwayne6037 3 роки тому

    Very amazing video... Stuff explained far better than those big/famous youtube channels...

  • @jv18creator
    @jv18creator 3 роки тому +1

    9 dislikes? the only thing I didn't understand throughout the tutorial. Good job man

  • @HeroKiller-rh6vx
    @HeroKiller-rh6vx Рік тому

    Great video man, watched it with breakfast and feel like i got a great understanding

  • @澳贼
    @澳贼 2 роки тому +1

    best explanation!! thank you !

  • @muhammadmohsinhussain5428
    @muhammadmohsinhussain5428 Рік тому

    I was scaring by the name of context API before watching your video. Finally I've learned. Thanks Dear....

  • @FranciscoBourquin
    @FranciscoBourquin Рік тому

    Excellent clear and simple explanation man. Thanks! You got a new subscriber.

  • @amitsinghania2260
    @amitsinghania2260 2 роки тому

    I have been watching your videos for quite some time. You make the topic very understandable and easy to implement.Gr8 going, keep up the good work. Thanks.

  • @soyabogadodeldiablo
    @soyabogadodeldiablo 2 роки тому

    Thank you so much Pedro!!!! You couldn't have explained this better. This was exactly what I was looking for my project!!!

  • @enmimaquinaandaba
    @enmimaquinaandaba 3 роки тому +1

    I finally understood context API. Thanks!

  • @ThColinPereira
    @ThColinPereira 3 роки тому +2

    Great video again, Pedro! This was explained so well!

  • @rickrudloff2151
    @rickrudloff2151 Рік тому

    Best explanation I have seen on this topic and perfect for beginners. Very easy to follow!

  • @fares.abuali
    @fares.abuali 3 роки тому +3

    Thanks for creating this video straight to the point. Such a great tutorial 👏🏻

  • @williamlawrence1044
    @williamlawrence1044 Рік тому

    Best explanation I’ve come across

  • @AntNZ
    @AntNZ 2 роки тому

    Props for this one. One of the best explanations of context I have found :)

  • @jjjie59
    @jjjie59 Рік тому

    Thanks. it helps a lot, content is straight to the point

  • @dawid-bobowski
    @dawid-bobowski 2 роки тому

    Thank you very much for this video. You clearly described how does Context API work and thanks to you, I was able to implement it in my project!

  • @ocirnevi15
    @ocirnevi15 2 роки тому +1

    Excellent explanation, thank you for sharing!!!

  • @JoseOrtega-oc9ip
    @JoseOrtega-oc9ip 2 роки тому

    Awesome explanation Pedro! Straight to the point!
    Thanks for sharing!

  • @SiddheshMangela
    @SiddheshMangela 3 роки тому

    Thanks a lot. Wanted to use it on a project, did not know how to but now I do

  • @chisomprogress5238
    @chisomprogress5238 3 місяці тому

    Thank you very much for this tutorial. You simplified it to my best understaniding.

  • @kayengxiongtongsuatong4132
    @kayengxiongtongsuatong4132 3 роки тому +1

    Amazing!!! The best Context Tutorial ever

  • @HeyNoah
    @HeyNoah 2 роки тому

    Loved this video! Thanks so much Pedro!

  • @prayascsa6601
    @prayascsa6601 2 роки тому

    this video was absolute POGGERS

  • @ilhamadiputra4745
    @ilhamadiputra4745 4 роки тому +1

    At last... State management 👏👏. Much much thanks

    • @PedroTechnologies
      @PedroTechnologies  4 роки тому +1

      Thank you! This is an introduction video, but I am planning on bringing an awesome React project using a lot of State Management with the Context API!

    • @ilhamadiputra4745
      @ilhamadiputra4745 4 роки тому

      Im looking forward to that project! Im still struggling in react state management, i dont know what to use, what state management to use for newbie like me. Thank you very much. WAITING FOR 3K SUBS THO & good luck 👏💪

  • @Byte-Simplified
    @Byte-Simplified 3 роки тому +1

    loved it man!! thanks for this short tutorial :)

  • @ingeniousgoldie
    @ingeniousgoldie 5 місяців тому

    Very clear explanation. Thank you for this video.

  • @Tamilanda7T
    @Tamilanda7T Рік тому

    thank u so much bro i understand working concept of context api in 10 minutes

  • @vishnuravva7992
    @vishnuravva7992 Рік тому

    Simple and on point explanation 👍

  • @demiladejulius5792
    @demiladejulius5792 8 місяців тому

    This is really great Pedro. thank you

  • @RoyZou
    @RoyZou Рік тому +1

    Thanks!

  • @abidinberkay1
    @abidinberkay1 2 роки тому

    finally found a video which goes to the point directly without any unnecessary details, thanks man. I have a question: you have provided all username-setusername-setshowprofile to the children as parameter of LoginContext provider, lets think we have tens of values that need to be shared so do we have to write them all one by one as parameter ? Or is there anyother way like defining them in LoginContext.js etc. ?

  • @niranjanjathar3748
    @niranjanjathar3748 3 роки тому

    The way you teach is very appreciable 🔥🔥👌

  • @darpananeja6755
    @darpananeja6755 Рік тому

    Exactly what I needed!!!

  • @ramonmaximiliano3557
    @ramonmaximiliano3557 2 роки тому

    This was really a perfect explanation man, thank you

  • @muneebahmad8772
    @muneebahmad8772 Рік тому

    I liked the way you are teaching us. Awesome

  • @fhkodama
    @fhkodama 2 роки тому

    One more hook learned and used in my portfolio! Thanks, Pedro!

  • @jessezam
    @jessezam 10 місяців тому

    Good explanation of how to use the Context API!
    Beginners should know that this may not be the best example for when you should utilize Context. Since this example requires lifting up the username and showProfile states only one level, it would be more straightforward to pass the necessary state and setState functions from the App component level to the Profile and Login components as props than to use context.
    I enjoyed the content nonetheless. Thanks Pedro.

  • @0Ipsita0
    @0Ipsita0 3 роки тому

    Well understood with less time. Very much help video. Thank you @Pedro keep going.

  • @samuelnjenga7912
    @samuelnjenga7912 2 роки тому +1

    What an amazing explanation, 💯👌

  • @ArnabKrDas
    @ArnabKrDas 11 місяців тому

    To the point explanation. Thanks man

  • @ahmetkarakartal9563
    @ahmetkarakartal9563 Рік тому

    This is what I need it. Thank you so much

  • @coderjag8828
    @coderjag8828 2 роки тому

    Thank you for your videos bro, especially the React ones. Keep it up bro they're very helpful!

  • @davidhernandez9275
    @davidhernandez9275 3 роки тому +1

    Thank you! Finally I understood Context API. I just have a question, so all states should be saved in the App.js Component?

    • @PedroTechnologies
      @PedroTechnologies  3 роки тому +1

      Glad you liked it! It depends, you can start your context states anywhere you want as long as it is a component and it is the component above the other components using the states in the component tree!

    • @davidhernandez9275
      @davidhernandez9275 3 роки тому

      @@PedroTechnologies Thank you!

  • @danielroyston-lopez3147
    @danielroyston-lopez3147 11 місяців тому +1

    Why do you need showProfile or setShowProfile when you are setting a username? If a username exists then that means you are logged in

  • @LaibaAhmad-i5o
    @LaibaAhmad-i5o 7 місяців тому

    thnks bruh! it was much needed..i only got it from you

  • @makanmusty
    @makanmusty Рік тому

    Great video. I’ve literally just subscribed.

  • @donnazukowski
    @donnazukowski 2 роки тому

    Awesome video. I'm putting together a simple project and didn't want to use redux. This was a huge help to just pass simple data. Thank you so much. I'm watching your other videos as well!

  • @it_student855
    @it_student855 Рік тому

    Best one I can understand from him well

  • @robertmasters01
    @robertmasters01 3 роки тому +1

    great refresher that I needed! thanks! instant sub :)

  • @tahaimran24
    @tahaimran24 3 роки тому

    Amazing Tutorial Bro... You Got A new Sub.. Keep the good work up

  • @ahmedalaaezzat
    @ahmedalaaezzat Рік тому

    Thank you I enjoyed the video, it's simple and clear ❤

  • @aivkhairulamirin9004
    @aivkhairulamirin9004 3 місяці тому

    I understand it well. TQ for this awesome video

  • @thydevdom
    @thydevdom 2 роки тому

    Simple solution. Thank the lord. UA-cam is filled with tutorials that do WAY too much to show a simple example. This is a great Video!

  • @subhendudey1786
    @subhendudey1786 Рік тому

    Very good onpoint no extra time compact tutorial

  • @kaenovama
    @kaenovama 3 роки тому

    My god, this is clearly explained. Thankss!

  • @GabrielMartinez-ez9ue
    @GabrielMartinez-ez9ue 2 роки тому

    Thank you. For this case, isn't it almost the same as prop drilling?

  • @thedevhacker4608
    @thedevhacker4608 3 роки тому +1

    Amazing I couldn't understand it until now

  • @IvanBilan-ty9jw
    @IvanBilan-ty9jw 7 місяців тому

    Great video, simple and effective

  • @mabrarhassan
    @mabrarhassan Рік тому

    This video has nicely explained the concept.

  • @11balajir20
    @11balajir20 2 роки тому

    Thank u so much brother....the best explanation I got

  • @nihaalshetty6288
    @nihaalshetty6288 4 місяці тому

    Good video sir! this and hitest choudhary video made my concept clear

  • @soltiscd
    @soltiscd 3 роки тому +1

    Really good. Succinct and precise

  • @shahzadasalman8461
    @shahzadasalman8461 3 роки тому +1

    great tutorial. good luck and waiting for more stuff.

  • @f3-faithfitnessfinance
    @f3-faithfitnessfinance 4 роки тому +3

    Aaah love context❤️

  • @pavanilla4374
    @pavanilla4374 4 роки тому +12

    useContext +useReducer =🧨🧨

  • @Lydeliini
    @Lydeliini 11 місяців тому

    Thanks for this clear explanation! I still feel there should be easier way to execute such a simple feature... I'm quite a noob with full stack/ web dev and don't know much about these but I'm questioning the value of learning React. It's not very intuitive and it seems to be quite complex and hard to learn, is it really worth putting in all the hours to learn to use it?

  • @djkujo007
    @djkujo007 3 роки тому

    Very helpful video and your explanation was easy to understand. Thanks!

  • @davidhernandez9275
    @davidhernandez9275 3 роки тому +1

    And another question, when would it be convenient using Context and when using Redux? Thank you so much!

    • @PedroTechnologies
      @PedroTechnologies  3 роки тому +2

      I would say context api is good for simple / intermediate projects and smaller component groups in big projects

  • @zakariasassi
    @zakariasassi 2 роки тому

    😍😍😍😍😍😍😍 finaly

  • @ayjayaywhy
    @ayjayaywhy 3 роки тому

    very clearly explained. thanks a lot!

  • @liza_Vetka-k1w
    @liza_Vetka-k1w 8 місяців тому

    cool, thanks man! very helpful!