useContext Crash Course - Manage State Globally with this React Hook
Вставка
- Опубліковано 3 січ 2025
- This is one video of a larger React Hooks series. In this video, we cover useContext, which is a very popular hook to manage state globally.
Github Repo:
github.com/har...
bro after too many videos and too many Udemy courses I have, none of them explain like u I was so confused bro and I was so tired about useContext but now I just found u and I swear I say this is the last video but finely ur so good bro now I understand and I did SUB and LIKE and I'm gone to watch again and this time I follow u coding thx bro
this is the best tutorial of useContext well explained that I can finally understand among youtube tutorials, Thank you !
This is the best context tutorial I've ever seen!
This is the best explanation on useContext that I have seen
I had such a hard time wrapping my head around useContext. This video is great. Thank you!
The next generation channel, here I will stay. You're awesome dude!
I think by far the best video to understand useContext for beginners
Thanks a ton
Hey! Thanks a lot. The most clear and to the point introduction to useContext and createContext on youtube. Cheers and may you have a good day!
Best explanation of useContext I have come across, yet.
Bro that was the best explanation on this hook that i've seen over youtube. Thanks. Now I ca go back to my React course ...
omg, what an amazing explanation, for the first thirteen minutes i was like wtf, this dude didn't even talk about useContext yet. But as you said that part was necessary to learn the underlying concept of useCOntext. Thanks dude
laith, your teaching style is up there as the best imo. and ive watched waaay too many tutorials lol. keep up the great work mate!
Loving all the videos so far!
best React useContext tutorial out there. Thank you
This was really good. I love the way you presented the different components with the shapes to really illustrate how it works 💪
I am glad I came across your channel. Quick, short but very informative at the same time videos. You are very good teacher and I know how to pass the knowledge. Subscribed a waiting for more video from you :). Good job and thank you !
you are the best teacher of all, even among those paid ones! Appreciate for your work.
Couldn't have explained it any better 👏👏👏
It was so easy to understand. I'm glad you break it down this way and now I understand. Thanks
Thank you so much! What you explained here helped me much better than that from the offcial react article.
How can I change the state in the last component in this example
Dude, thank you. the videos you are doing are great, and the explanation is on point. keep the other videos coming :D
This vid makes useContext so simple! I have a question about performance though: I heard useContext should be used sparingly since it causes a lot of rerenders. Any tips on performance optimizations? For example, if the context is only used in the parent and 5th child, do all the children in between also get rerendered? Are there ways to make it so that only the child element that needs a rerender is actually rerendered?
Yes there are ways, one of the ways I recently learnt is to memoize child components so that they do not re render with context changes.
Thanks for the new video, eagerly waiting for your videos
Awesome content bro! I suggest you create playlist by subject so it will be easier to find content in your channel
How do you send a new value up back to the parent using UseContext?
Just use: const [count, setCount] = useContext(CountContext) in a Child5 component , and it will "set" count State in a Child1...
Are you planning to do a tuto on portals, fowards and useRef? This is hard to find good tutorial on these subjects :(
Hey Laith, might want to use "outline: 0.1rem; " for all your Child components next time to avoid that weird black border on the top-left of all your boxes. Just a tip!
The best explanation, Superb! Thanks dude.
how can we use context between two sibling components?
such a great tutorial about useContext
Watch from 11:40 for useContext bits.
Actually, from 18:00 onwards.
The problem I have with this (which is not a problem I have with redux) is that changing the context's state will re-render every component inside of the .Provider
Do you know how to prevent this from happening? In your example, you only want to re-render Child1 and Child5
Perfectly summed, so the CounterContex.Consumer isn't important?
also lifting up state with useContext, does it work backward? (I mean you can send a function to get data at the end of the component)
But the problem arrives, when you need to take data from a far away grandchild, lift it up to the App , and then send it to another distant branch
You are the man Laith 👏👏👏
This is Awesome! Great tuts & Thanks so much!
Thank you. The exact content I wanted. Great content.
Thanks for great explanation!
really really good job. Thank you bro
Loved this
very precise and to -the -point video, love from india,keep up the good work
and pls can u explain exactly why usecontext will not work in app.js?
edit- i watch it again, now it's crystal clear
شكرا يا باشا
Nice explaination!! One doubt .... What if we want to change the value of the state that we are consuming in the child component ? How we can change it ? Do we need to pass the setCount function also using Provider ? Please answer me if anyone have the solution fir this doubt. Thanks
Thanks, subscribed.
amazing
Made it clear 🙂
Thank you
18:05 useContext solution
thinks bro!!!!
I don't speak good English, but I would have understood this video if he hadn't spoken, Thx ❤
so technically it's not global if it can only be passed down to child components..
{2023-10-14}
OMG bro u really didn't need to do all those illustration, lol..
Nice video though
I am not gay, but I love you.
Thank youuuu
thank you