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

  Рет қаралды 72,107

RoadsideCoder

RoadsideCoder

Күн бұрын

#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 ...

Пікірлер: 152
@mutantthegreat7963
@mutantthegreat7963 2 жыл бұрын
Thanks man. Coming from Vue, I found it hard to understand how to avoid using redux, but this video pointed it out, -thanks!
@alaluddin6651
@alaluddin6651 Жыл бұрын
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 💛💛💛
@adaezeikemefuna9592
@adaezeikemefuna9592 2 жыл бұрын
You broke this down and explained it so well. Thanks!
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
😄🙏
@kumarshubham919
@kumarshubham919 2 жыл бұрын
It is the Simplest Explanation possible. I'm like that 🤯
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
😁😁🤘🤘
@Tahir_Musharraf
@Tahir_Musharraf Жыл бұрын
Explained very well. Thank You!
@ashwinpatidar2878
@ashwinpatidar2878 9 ай бұрын
This is very helpful video for understanding useContext() Hook with good in project demo. Awesome explanation and information.
@faisalahammad
@faisalahammad 2 жыл бұрын
You're amazing bro, I've beening stuck for context API last a few weeks. :(
@rakaa31
@rakaa31 2 жыл бұрын
your react videos are so helpful!
@surajkumar-wz1br
@surajkumar-wz1br 2 жыл бұрын
Thanks, bro, This is the real scenario Project.👍 I subscribed to your channel
@sohadmad1823
@sohadmad1823 Жыл бұрын
Amazing!!!Thank you very much😍😍
@azadhuseynzade8543
@azadhuseynzade8543 Жыл бұрын
Thanks,You explained so well👍
@sheydahafezifar8850
@sheydahafezifar8850 Жыл бұрын
it was really helpful. thank you so much!
@simple8810
@simple8810 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!
@vivekgoswami1474
@vivekgoswami1474 Жыл бұрын
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'
@gaurisharma2253
@gaurisharma2253 Жыл бұрын
Thank you so much
@Reshmajain-jd1ed
@Reshmajain-jd1ed 10 ай бұрын
U saved my day .Thank u so much
@hirentecheshta3290
@hirentecheshta3290 Жыл бұрын
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 Жыл бұрын
Yes, use callback in child
@rajatraj3160
@rajatraj3160 Жыл бұрын
@@gouravprajapati3270 callback or event bubbling (lifting state up)
@cswithabdullah2638
@cswithabdullah2638 2 жыл бұрын
Thank you very much for this valuable tutorial.
@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 !
@RoadsideCoder
@RoadsideCoder Жыл бұрын
Awesome ❤️🌟
@ascodes3461
@ascodes3461 Жыл бұрын
It was realllllly an amazing tutorial, Thank you soo much for this. It helped a lot😍🤩😇
@RoadsideCoder
@RoadsideCoder Жыл бұрын
❤️🙏
@Dev-Phantom
@Dev-Phantom Жыл бұрын
good understanding .... i really liked it.
@mohitsaud2071
@mohitsaud2071 2 жыл бұрын
Thank you for your wonderful teaching. Love from Nepal.
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
🙏🔥
@ziyaulrana1840
@ziyaulrana1840 2 жыл бұрын
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 KZbin
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Wow, Thank you so much for appreciating, means a lot.
@dimitriitkach7697
@dimitriitkach7697 Жыл бұрын
thanks for React Context API with Project | useContext Hook | createContext | State Management Tutorial
@gilbertmizrahi5471
@gilbertmizrahi5471 Жыл бұрын
Thank you. This is very useful. 👌
@arpitkolwar5916
@arpitkolwar5916 10 ай бұрын
thanks a lot brother for the first time i understood this subscribed and liked also watching your other videos .
@RoadsideCoder
@RoadsideCoder 10 ай бұрын
Glad it helped
@narenNKchaudhary
@narenNKchaudhary Жыл бұрын
Can you share what best extension of VS code, we can use for the quick coding?
@RahulKumar-ew1qw
@RahulKumar-ew1qw 2 жыл бұрын
Thnx bro, I will wait your next video..👍
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Soon 🤟
@27Jaswanth
@27Jaswanth 2 жыл бұрын
Hey bro, faker isn't working here.. Any solution ?
@wolverine_d_king9422
@wolverine_d_king9422 Жыл бұрын
Superb explanation❤️
@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
@IllIIIIIIllll
@IllIIIIIIllll 5 ай бұрын
Thank you sir ❤.
@chronicinsomnia8712
@chronicinsomnia8712 Жыл бұрын
Is there any way to handle cart items quantity and single item price based on qty using context ?
@alexcostal3749
@alexcostal3749 Жыл бұрын
Amazing Video Brother 😎
@rilangkishabong1723
@rilangkishabong1723 2 жыл бұрын
Very helpful content. Thank you brother
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Glad u liked it!
@anilkapse3415
@anilkapse3415 Жыл бұрын
Hey brother, this is a really awesome video about context API.
@RoadsideCoder
@RoadsideCoder Жыл бұрын
🙏❤️
@rangabharath4253
@rangabharath4253 2 жыл бұрын
Awesome as always bro 🥳🎉
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Thanks mate
@usa5450
@usa5450 Жыл бұрын
Underrated channel
@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.
@RoadsideCoder
@RoadsideCoder Жыл бұрын
❤️❤️ Thank you so much
@viralthakar164
@viralthakar164 18 күн бұрын
Superb tutorial ❤❤❤❤
@RoadsideCoder
@RoadsideCoder 18 күн бұрын
Thanks a lot 😊
@anujgupta9167
@anujgupta9167 2 жыл бұрын
Awesome as always bro
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
🤘🤘
@brave364
@brave364 4 ай бұрын
really a great work bro
@RoadsideCoder
@RoadsideCoder 4 ай бұрын
Thanks ✌️
@JoshuaMusau
@JoshuaMusau 8 ай бұрын
Thanks man...
@PraveenKumar-ft2kr
@PraveenKumar-ft2kr 2 жыл бұрын
Soo good brother... Thank you 😃
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Welcome 🙏
@jorgedelamora5905
@jorgedelamora5905 2 жыл бұрын
Bro you are such a nice guy, ty!
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
U too :)
@chiranjeevichowdary5948
@chiranjeevichowdary5948 2 жыл бұрын
Waiting for the next video
@A9kit.k
@A9kit.k 2 жыл бұрын
Great 👏🏻👏🏻
@ShahnewazTameem
@ShahnewazTameem Жыл бұрын
which extension you are using for auto camel case while typing the state expression?
@RoadsideCoder
@RoadsideCoder Жыл бұрын
just press "tab" key when u type the name
@jsagar95
@jsagar95 Жыл бұрын
Thanks!
@dhirajshah6738
@dhirajshah6738 11 ай бұрын
osm brother...
@ashish_prajapati_tr
@ashish_prajapati_tr 2 жыл бұрын
you are awesome
@arupde6320
@arupde6320 2 жыл бұрын
good job .. keep uploading .
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Thanks man
@kyawzinthant170
@kyawzinthant170 2 жыл бұрын
amazing just finish it
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Great!
@capricious-agent-007
@capricious-agent-007 Жыл бұрын
thanks
@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
@webber5629
@webber5629 Жыл бұрын
how to change Total price if we increase the quantity of item
@rishabhtripathi6032
@rishabhtripathi6032 2 жыл бұрын
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 Жыл бұрын
Hey ur prblm solved not? I am also facing same issue
@rishabhtripathi6032
@rishabhtripathi6032 Жыл бұрын
@@vivekgoswami1474 not yet because faker.js package are outdated and not working do you have any Solution ?
@vivekgoswami1474
@vivekgoswami1474 Жыл бұрын
@@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'
@sanketsuryawanshi
@sanketsuryawanshi 2 жыл бұрын
Thanks a lot
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
🙏🙏
@excellencevictorkingsley6921
@excellencevictorkingsley6921 Жыл бұрын
Is faker still in use this 2023?
@fazilhakkim1091
@fazilhakkim1091 Жыл бұрын
fakers is not working for me bro can you please help
@kanganagarwal
@kanganagarwal 2 жыл бұрын
Awesome
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Thanks!
@AGriffith
@AGriffith 2 жыл бұрын
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
@nehanalini1606
@nehanalini1606 2 жыл бұрын
faker is not working..I see nothing in the npm official page
@chiranjeevichowdary5948
@chiranjeevichowdary5948 2 жыл бұрын
Waiting for ur next video from a week upload it asap!!
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Yes!! Sunday definitely
@chiranjeevichowdary5948
@chiranjeevichowdary5948 2 жыл бұрын
@@RoadsideCoder ok
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Follow me on Instagram @RoadsideCoder for all the updates
@RahulKumar-ew1qw
@RahulKumar-ew1qw 2 жыл бұрын
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 2 жыл бұрын
Maybe you haven't imported in index.js. Try to compare with my code, it's in description
@RahulKumar-ew1qw
@RahulKumar-ew1qw 2 жыл бұрын
I have done bro , app is now working
@sachinlingwal2325
@sachinlingwal2325 2 жыл бұрын
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?
@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?
@GMERT
@GMERT 2 жыл бұрын
Hello. please do a video of paxful clone for us. along with the backend.
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
I've already done a video on Cryptocurrency tracker, check my videos
@noobCoder26
@noobCoder26 2 жыл бұрын
great
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
🤘
@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 Жыл бұрын
Gyuz my faker not working what is d issue anyone here can help?
@vivekgoswami1474
@vivekgoswami1474 Жыл бұрын
@@manoyal help
@vivekgoswami1474
@vivekgoswami1474 Жыл бұрын
@@abhisekgupta1543 help
@davidbaraiya2649
@davidbaraiya2649 Жыл бұрын
so can you make a video in hindi too ? my english is not a good at understand.
@kollivenkatesh2545
@kollivenkatesh2545 2 ай бұрын
Images not displayed
@anandpothraj1914
@anandpothraj1914 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 Жыл бұрын
Thanx man
@anandpothraj1914
@anandpothraj1914 Жыл бұрын
@@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
@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
@jorgedelamora5905
@jorgedelamora5905 2 жыл бұрын
How can i do it with local json?
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Just replace faker variable with json object
@jorgedelamora5905
@jorgedelamora5905 2 жыл бұрын
Tried and got error :(
@darjipavan5112
@darjipavan5112 2 жыл бұрын
React JS me Education website banaiye sir ji 🤗
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
Sure! 👍
@darjipavan5112
@darjipavan5112 2 жыл бұрын
@@RoadsideCoder 🏋️💁 thanks
@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?
@aishwarysaxena505
@aishwarysaxena505 9 ай бұрын
@faker is no more!!!
@parijatkumar1406
@parijatkumar1406 Жыл бұрын
faker is not working
@ajadreddy3851
@ajadreddy3851 2 жыл бұрын
Yaar this is not at all working ,always showing a bunch of errors even if i copy the code
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
What's the error?
@pawan_kumar5555
@pawan_kumar5555 11 ай бұрын
faker npm is not working and other error please fix this source code in updated version
@smrpkrl
@smrpkrl 6 ай бұрын
5:24
@sahilsharma1inspirationalTape
@sahilsharma1inspirationalTape Жыл бұрын
ya to smjhaale ya fir css kr le
@keerthimurgan4809
@keerthimurgan4809 11 ай бұрын
whatever you coded im not getting here properly
@satrioutomo1077
@satrioutomo1077 2 жыл бұрын
enable subtitle pls
@RoadsideCoder
@RoadsideCoder 2 жыл бұрын
There must be autogenerated ones
@alimirhashimli2727
@alimirhashimli2727 Жыл бұрын
I think this faker does not work
@abhishekthakur7578
@abhishekthakur7578 11 ай бұрын
bhai itne fast mat kyu pada rahe ho kahi jana hai kya
@RoadsideCoder
@RoadsideCoder 11 ай бұрын
ha pressure ban rha hai
@imnemo2327
@imnemo2327 2 жыл бұрын
🤯🤯🤯🤯🤯😨😨 🚪🚶
@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 Жыл бұрын
Uski English toh sahi hai but Tum Apni sahi kr lo. ✌🏻
All React Hooks Tutorial + Building a Custom Hook in React JS
45:50
RoadsideCoder
Рет қаралды 25 М.
Context API in react | get the concept
29:00
Hitesh Choudhary
Рет қаралды 38 М.
Dynamic #gadgets for math genius! #maths
00:29
FLIP FLOP Hacks
Рет қаралды 16 МЛН
it takes two to tango 💃🏻🕺🏻
00:18
Zach King
Рет қаралды 26 МЛН
Code Splitting in React JS - Lazy Loading Performance Optimization
16:10
Learn useContext In 13 Minutes
13:08
Web Dev Simplified
Рет қаралды 689 М.
Why I avoid useEffect For API Calls and use React Query instead
17:45
Learn React useReducer Hook with Examples
14:19
Lama Dev
Рет қаралды 166 М.
This React UI Library is GAME CHANGER!
18:13
developedbyed
Рет қаралды 511 М.