React Context API with Project | useContext Hook | createContext | State Management Tutorial

Поделиться
HTML-код
  • Опубликовано: 15 июл 2024
  • #Reactjs #ContextAPI #useContext #reactcontext
    Learn Context API by making simple Shopping Cart Project in React JS in one video. We will learn Context API hooks such as useContext and createContext in React JS.
    Source Code -
    github.com/piyush-eon/youtube...
    If any questions, ask here -
    / roadsidecoder
    MERN Stack Tutorial with Redux 2021 -
    • MERN Stack Project Tut...
    00:00 Intro
    00:15 State Management Example
    02:04 Context API - State Management
    03:00 Setup New React JS App
    04:43 Making UI for Shopping Cart
    09:54 Generating Products Data with Faker
    12:40 Single Product UI
    16:27 Cart UI
    18:17 Cart State
    21:24 Shifting the State to Parent
    24:06 Total Price Logic
    26:10 Problem without Context
    26:48 Context API Implement
    29:14 useContext Hook
    33:13 Conclusion
    33:47 Context API with useReducer Video
    35:20 Support the channel!
    React Router DOM Tutorial-
    • React Router Dom [ Ful...
    Movie App in React JS and Material UI -
    • Movies and TV Series S...
    Quiz App in React JS and Material UI -
    • Quiz App in React JS w...
    Dictionary App in React JS and Material UI -
    • 12 Language Dictionary...
    Learn React From Scratch -
    • React JS Workshop Day ...

Комментарии • 153

  • @mutantthegreat7963
    @mutantthegreat7963 2 года назад +2

    Thanks man. Coming from Vue, I found it hard to understand how to avoid using redux, but this video pointed it out, -thanks!

  • @adaezeikemefuna9592
    @adaezeikemefuna9592 2 года назад +11

    You broke this down and explained it so well. Thanks!

  • @alaluddin6651
    @alaluddin6651 Год назад +10

    Really, I can't express my gratitude for this awesome video. I was looking like this video since almost one month but finally i got here 💌💌💌. This video had took me 4 hours to complete with you. I am really thankful to you sir 💛💛💛

  • @kumarshubham919
    @kumarshubham919 2 года назад +3

    It is the Simplest Explanation possible. I'm like that 🤯

  • @rakaa31
    @rakaa31 2 года назад +1

    your react videos are so helpful!

  • @Tahir_Musharraf
    @Tahir_Musharraf Год назад

    Explained very well. Thank You!

  • @ashwinpatidar2878
    @ashwinpatidar2878 11 месяцев назад +2

    This is very helpful video for understanding useContext() Hook with good in project demo. Awesome explanation and information.

  • @azadhuseynzade8543
    @azadhuseynzade8543 Год назад +1

    Thanks,You explained so well👍

  • @faisalahammad
    @faisalahammad 2 года назад

    You're amazing bro, I've beening stuck for context API last a few weeks. :(

  • @sohadmad1823
    @sohadmad1823 Год назад

    Amazing!!!Thank you very much😍😍

  • @sheydahafezifar8850
    @sheydahafezifar8850 Год назад

    it was really helpful. thank you so much!

  • @surajkumar-wz1br
    @surajkumar-wz1br 2 года назад

    Thanks, bro, This is the real scenario Project.👍
    I subscribed to your channel

  • @cswithabdullah2638
    @cswithabdullah2638 2 года назад

    Thank you very much for this valuable tutorial.

  • @ziyaulrana1840
    @ziyaulrana1840 2 года назад +4

    I really appreciated your way of teaching. I got Helped a lot from this video.
    First impression is last impression.
    I subscribed your channel.
    Thanks for being here on RUclips

    • @RoadsideCoder
      @RoadsideCoder  2 года назад +1

      Wow, Thank you so much for appreciating, means a lot.

  • @gilbertmizrahi5471
    @gilbertmizrahi5471 Год назад

    Thank you. This is very useful. 👌

  • @simple8810
    @simple8810 2 года назад +2

    Tbh I am working on the project and it has the same features as you have explained in first few minutes , I was trying to manage by simple props drilling , first it was messy , second I am not able to get the state defined in one and need to pass to another , So I thought to use contextAPI, and Ur video helped me Thanks

    • @RoadsideCoder
      @RoadsideCoder  2 года назад

      Awesome dude, Feels great to hear that!

  • @ascodes3461
    @ascodes3461 2 года назад +1

    It was realllllly an amazing tutorial, Thank you soo much for this. It helped a lot😍🤩😇

  • @Dev-Phantom
    @Dev-Phantom Год назад +1

    good understanding .... i really liked it.

  • @PradeepSingh-fq3zr
    @PradeepSingh-fq3zr Год назад

    First of all very very Thanks, sir! I was very doubting in contest API but after watching your video my all doubt is clear. once again thanks, sir !

  • @usa5450
    @usa5450 Год назад

    Underrated channel

  • @mohitsaud2071
    @mohitsaud2071 2 года назад

    Thank you for your wonderful teaching. Love from Nepal.

  • @wolverine_d_king9422
    @wolverine_d_king9422 Год назад

    Superb explanation❤️

  • @RahulKumar-ew1qw
    @RahulKumar-ew1qw 3 года назад

    Thnx bro, I will wait your next video..👍

  • @rangabharath4253
    @rangabharath4253 3 года назад

    Awesome as always bro 🥳🎉

  • @anujgupta9167
    @anujgupta9167 2 года назад

    Awesome as always bro

  • @alexcostal3749
    @alexcostal3749 Год назад

    Amazing Video Brother 😎

  • @IllIIIIIIllll
    @IllIIIIIIllll 7 месяцев назад

    Thank you sir ❤.

  • @A9kit.k
    @A9kit.k 2 года назад

    Great 👏🏻👏🏻

  • @jorgedelamora5905
    @jorgedelamora5905 2 года назад

    Bro you are such a nice guy, ty!

  • @JoshuaMusau
    @JoshuaMusau 10 месяцев назад

    Thanks man...

  • @arpitkolwar5916
    @arpitkolwar5916 Год назад

    thanks a lot brother for the first time i understood this subscribed and liked also watching your other videos .

  • @rilangkishabong1723
    @rilangkishabong1723 3 года назад

    Very helpful content. Thank you brother

  • @hirentecheshta3290
    @hirentecheshta3290 2 года назад +13

    around 21.42 minutes you said we can't pass state child to the parent component, but in react, there is a concept called Lifting State up is used to pass data from child to parent. Am I RIght?

    • @gouravprajapati3270
      @gouravprajapati3270 Год назад +3

      Yes, use callback in child

    • @rajatraj3160
      @rajatraj3160 Год назад

      @@gouravprajapati3270 callback or event bubbling (lifting state up)

  • @chiranjeevichowdary5948
    @chiranjeevichowdary5948 3 года назад

    Waiting for the next video

  • @PraveenKumar-ft2kr
    @PraveenKumar-ft2kr 2 года назад +1

    Soo good brother... Thank you 😃

  • @dimitriitkach7697
    @dimitriitkach7697 Год назад

    thanks for React Context API with Project | useContext Hook | createContext | State Management Tutorial

  • @jsagar95
    @jsagar95 2 года назад

    Thanks!

  • @brave364
    @brave364 5 месяцев назад

    really a great work bro

  • @viralthakar164
    @viralthakar164 2 месяца назад

    Superb tutorial ❤❤❤❤

  • @kyawzinthant170
    @kyawzinthant170 2 года назад

    amazing just finish it

  • @ashish_prajapati_tr
    @ashish_prajapati_tr 2 года назад +1

    you are awesome

  • @vivekgoswami1474
    @vivekgoswami1474 2 года назад +6

    Those who are stuck in the Faker....
    First- npm uninstall faker
    Second - npm install -save-dev faker@5.5.3
    Step 3 restart server and then
    import faker from 'faker'

  • @anilkapse3415
    @anilkapse3415 2 года назад

    Hey brother, this is a really awesome video about context API.

  • @dhirajshah6738
    @dhirajshah6738 Год назад

    osm brother...

  • @hitsharnam3177
    @hitsharnam3177 Год назад

    I like your video as soon as i click on it. Because i know it's going to be awesome. You are amazing.

  • @narenNKchaudhary
    @narenNKchaudhary Год назад

    Can you share what best extension of VS code, we can use for the quick coding?

  • @capricious-agent-007
    @capricious-agent-007 Год назад

    thanks

  • @arupde6320
    @arupde6320 3 года назад

    good job .. keep uploading .

  • @sanketsuryawanshi
    @sanketsuryawanshi 2 года назад

    Thanks a lot

  • @kanganagarwal
    @kanganagarwal 2 года назад

    Awesome

  • @chronicinsomnia8712
    @chronicinsomnia8712 Год назад

    Is there any way to handle cart items quantity and single item price based on qty using context ?

  • @jigarjoshi9198
    @jigarjoshi9198 Год назад

    13:38 is not working to display the items of an array ? even in component prod given as prop but not taking values ...i checked my code its correct....no errors

  • @noobCoder26
    @noobCoder26 2 года назад

    great

  • @27Jaswanth
    @27Jaswanth 2 года назад +2

    Hey bro, faker isn't working here.. Any solution ?

  • @webber5629
    @webber5629 Год назад

    how to change Total price if we increase the quantity of item

  • @sashirkl
    @sashirkl 21 день назад

    And this is how u make a concept more complex. instead of explaining usecontext .

  • @ShahnewazTameem
    @ShahnewazTameem Год назад

    which extension you are using for auto camel case while typing the state expression?

    • @RoadsideCoder
      @RoadsideCoder  Год назад +1

      just press "tab" key when u type the name

  • @chiranjeevichowdary5948
    @chiranjeevichowdary5948 3 года назад

    Waiting for ur next video from a week upload it asap!!

  • @nehanalini1606
    @nehanalini1606 2 года назад +1

    faker is not working..I see nothing in the npm official page

  • @fazilhakkim1091
    @fazilhakkim1091 Год назад

    fakers is not working for me bro can you please help

  • @excellencevictorkingsley6921
    @excellencevictorkingsley6921 Год назад

    Is faker still in use this 2023?

  • @GMERT
    @GMERT 2 года назад

    Hello. please do a video of paxful clone for us. along with the backend.

    • @RoadsideCoder
      @RoadsideCoder  2 года назад +1

      I've already done a video on Cryptocurrency tracker, check my videos

  • @abhisekgupta1543
    @abhisekgupta1543 2 года назад

    at 35:30 my site do not show header home cart on home page even after changing url to localhost:3000/cart

    • @manoyal
      @manoyal 2 года назад

      use react router v6, the react router in this video is out dated, check the documentation online

  • @kollivenkatesh2545
    @kollivenkatesh2545 3 месяца назад

    Images not displayed

  • @AGriffith
    @AGriffith 2 года назад +1

    Is this still working? I think Faker library is now broken because of all the situation with Github and the author of the library.

    • @RoadsideCoder
      @RoadsideCoder  2 года назад

      Yeah, I believe it'll be working, or atleast the previous versions

  • @smrpkrl
    @smrpkrl 8 месяцев назад

    5:24

  • @RahulKumar-ew1qw
    @RahulKumar-ew1qw 3 года назад +1

    Why I am getting white page while using context api component not render ... And there is no error in code , can u help me bro give me suggestions...

    • @RoadsideCoder
      @RoadsideCoder  3 года назад +1

      Maybe you haven't imported in index.js.
      Try to compare with my code, it's in description

    • @RahulKumar-ew1qw
      @RahulKumar-ew1qw 3 года назад +1

      I have done bro , app is now working

    • @sachinlingwal2325
      @sachinlingwal2325 3 года назад

      same error

  • @akashghosh3257
    @akashghosh3257 Год назад

    Any help for Faker. I tried the older version too.

    • @priyankapriya9945
      @priyankapriya9945 Год назад

      yes faker is deprecated. it's no longer working now

    • @mausichilenduk7178
      @mausichilenduk7178 Год назад

      @@priyankapriya9945 No its working still. Use faker.js..... instead of random.image use image.abstract
      I am stuck in "Cannot read properties of undefined (reading 'includes')" can anyone help?

  • @davidbaraiya2649
    @davidbaraiya2649 Год назад +1

    so can you make a video in hindi too ?
    my english is not a good at understand.

  • @sumitsingh2889
    @sumitsingh2889 2 года назад

    Bro there is two version of your this project..
    the way you are doing on video and the code is on git
    both are different.
    please check again... i'm doing as it is but i'm getting error and error

    • @RoadsideCoder
      @RoadsideCoder  2 года назад

      That shouldn't be the case, what's different?

  • @rishabhtripathi6032
    @rishabhtripathi6032 2 года назад +1

    faker are not working what i do it says module not found but in package.json file it proper shows what I do?

    • @vivekgoswami1474
      @vivekgoswami1474 2 года назад

      Hey ur prblm solved not? I am also facing same issue

    • @rishabhtripathi6032
      @rishabhtripathi6032 2 года назад

      @@vivekgoswami1474 not yet because faker.js package are outdated and not working do you have any Solution ?

    • @vivekgoswami1474
      @vivekgoswami1474 2 года назад +1

      @@rishabhtripathi6032 Those who are stuck in the Faker....
      First- npm uninstall faker
      Second - npm install -save-dev faker@5.5.3
      Step 3 restart server and then
      import faker from 'faker'

  • @ronakkarmakar6356
    @ronakkarmakar6356 2 года назад

    Don't know why my browserrouter isn’t working when i wrap home and cart into browserrouter. I installed router dom and write the code as shown in this video but It's not working properly..
    Can anyone please fix my code?

    • @abhisekgupta1543
      @abhisekgupta1543 2 года назад

      Same issue bro...how did you fix it?

    • @manoyal
      @manoyal 2 года назад

      use react router v6, the react router in this video is out dated, check the documentation online

    • @vivekgoswami1474
      @vivekgoswami1474 2 года назад

      Gyuz my faker not working what is d issue anyone here can help?

    • @vivekgoswami1474
      @vivekgoswami1474 2 года назад

      @@manoyal help

    • @vivekgoswami1474
      @vivekgoswami1474 2 года назад

      @@abhisekgupta1543 help

  • @SeekerofUniverse33
    @SeekerofUniverse33 Год назад

    faker not working for me :( its not able to find faker even after correct package is installed

    • @camo4970
      @camo4970 Год назад

      you can make a separate component with all the data instead

  • @parijatkumar1406
    @parijatkumar1406 Год назад

    faker is not working

  • @jorgedelamora5905
    @jorgedelamora5905 2 года назад

    How can i do it with local json?

  • @aishwarysaxena505
    @aishwarysaxena505 11 месяцев назад +1

    @faker is no more!!!

  • @darjipavan5112
    @darjipavan5112 3 года назад

    React JS me Education website banaiye sir ji 🤗

  • @sahilsharma1inspirationalTape
    @sahilsharma1inspirationalTape Год назад +1

    ya to smjhaale ya fir css kr le

  • @tonywest341
    @tonywest341 2 года назад

    Anyone who has faced tried to delete items in the cart and all items got deleted , after using includes method

    • @RoadsideCoder
      @RoadsideCoder  2 года назад

      Maybe you're clearing the complete state?

  • @CodexGem
    @CodexGem 2 года назад +2

    for the people who is getting no module found faker
    use
    step 1 : npm uninstall faker
    step 2 : npm install --save-dev faker@5.5.3
    step 3 : restart development server
    and good to go

    • @Peterin
      @Peterin 2 года назад

      Can you please explain why normal npm install was not working?

    • @vivekgoswami1474
      @vivekgoswami1474 2 года назад

      Thanx man

    • @CodexGem
      @CodexGem 2 года назад +1

      @@Peterin the error was arising because of the faker library version when we type npm i faker it automatically downloads latest version but our project is using different means old version which doesn't support latest version so when ever you got error then immediately visit source code repo and inside compare your dependences with the project dependency inside package.json

  • @satrioutomo1077
    @satrioutomo1077 3 года назад

    enable subtitle pls

  • @ajadreddy3851
    @ajadreddy3851 2 года назад

    Yaar this is not at all working ,always showing a bunch of errors even if i copy the code

  • @alimirhashimli2727
    @alimirhashimli2727 Год назад

    I think this faker does not work

  • @imnemo2327
    @imnemo2327 2 года назад +1

    🤯🤯🤯🤯🤯😨😨 🚪🚶

  • @keerthimurgan4809
    @keerthimurgan4809 Год назад

    whatever you coded im not getting here properly

  • @pawan_kumar5555
    @pawan_kumar5555 Год назад +2

    faker npm is not working and other error please fix this source code in updated version

  • @AMG-cc7pi
    @AMG-cc7pi Год назад

    Bhai maine galti se redux ka use dekh liya, rona agaya , saala ek state update karne ke liye kya bawasir bana rakha hai react waalo ne

  • @Mukeshkrk108
    @Mukeshkrk108 Год назад

    English theek hai iski mgar ye msjha nhi pata hai , shayad bs dekh dekh ke kra rha hai ,

    • @TravelwithPujarini
      @TravelwithPujarini Год назад +2

      Uski English toh sahi hai but Tum Apni sahi kr lo. ✌🏻

  • @abhishekthakur7578
    @abhishekthakur7578 Год назад

    bhai itne fast mat kyu pada rahe ho kahi jana hai kya