Learn React Hooks: useContext - Simply Explained!
Вставка
- Опубліковано 24 тра 2023
- Join The Discord! → discord.cosdensolutions.io
Source Code → github.com/cosdensolutions/co...
In this video we will learn about React hooks, starting with useContext. This powerful React hook will allow you to manage your state efficiently without having to pass an enormous amount of props around (prop drilling). You will learn how to identify when to use the React Context API, how to use createContext to create the context, create a custom hook to handle undefined values, and finally use the context in any component to get access to the data.
In this new React world, hooks are here to stay, so it's best to learn them! In this tutorial I demonstrate the useContext React hook, and I explain it very simply and in a way that is easy to understand. Enjoy!
Hey everyone! I just launched 🚀 Project React, which is a course that teaches you React by building a real-world project. It goes way beyond what you see in these videos and walks you through step-by-step on how to build a big and complex application with React! You can check it out here: cosden.solutions/project-react
Thank you for the content. You have the gift to talk about coding in a simple way.
thank you for the kind words!
Thank you. I've been learning React for about 4 days and I was confused about the useContext and createContext, but your video explains it well. Thank you.
Wow you're a perfect teacher and programmer thanks for the time that you spent for this amazing content
Great tutorial! I was so confused about how Context works, every other creator complicates it too much. Thank you for simplifying it. Just subbed!
makes me happy to hear!
It's amazing you also taught how to deal with problems and showed proper way to code and handle potential errors.
This was the clearest explanation I've seen. Thank you!
Hands down best explanation of the topic on the tube. Thank you!
Wow! Such a excellent explanation and with examples too. Well done 👏👏👏👏
Glad you enjoyed it! 🤙
been loving the react tutorials man! dont think anyones ever explained context so simply :)
I hope your videos go viral soon like they should. You are doing a great work with your explanations
Haha imagine going viral for React 😅 would love it!
This was a really good explanation. I took notes and later was able to replicate a similar example. I now understand the useContext hook a lot better. I'm just starting with React and this is really my first application, although I work with a team in a project that already have a lot of react. I expect to become more proficient in React to really be able to work on that project. Keep the good work, I hope you get a lot of subscribers soon.
Really happy to hear that dude! You're going to do great ☺️ thank you for the kind words!
@@cosdensolutions please when are going to do a video on HOC
Thanks man, been watching your videos for the last 7 days. Practicing for mid-senior dev job...
Now I feel like a junior dev 😁, because of all the content I learnt. I "was" a "I can do it, but I can not explain it" person.
But the upside is now I "REALLY" know what to do.
Just subscribed.
And we need more videos on testing.
I subscribed!! This is a great way to explain the concept + thanks for adding the error handling part 👍
🤙
Great one with context, i like the way you handled the undefined scenario. Thanks for the tutorial.
Thanks for this great and clear explanation with a lot more edges. Hope you will get 1 million subs soon. Tbh, You deserve it.
Thanks a lot 🤙
you where one of the only youtubers who actually got me to subscribe to your channel. Nice way of implementing the idea 😃. And fantastic tutorials, crystal clear.
This was straight forward. Thank you for throwing in the extra error handling method as well 🔥
That was some good explanation, you made contexts seem obvious...Appreciated
Amazing tutorial.
Thanks a lot.
Really helpful video, thank you so much!
Fantastic tutorial. I really appreciate it. 😊
Great Explanation, Thank you!
Very well explained !!
Thank you man. That is good explanation
Thanks it was very helpful
After this video you really don't need to watch another video about react useContext. This was excellent video.
Bro I really love your content and I learn a lot from you, don't worry about subscribers, they will ultimately come to you as your way of explaining is so very good. Keep uploading contents.
thanks for the kind words! 🤙
Great job man. its very helpful !!
Definitely appreciate your attention to detail and have earned my sub. You helped me understand how I was having trouble with a boilerplate I use that has a useState inside a useEffect. I understand *what* the problem is now (thank you for that video), but I can't figure out what I need to learn to solve it. Thanks for at least helping me get closer.
Thanks bro, much appreciated !
Another great tutorial thanks so much!
Realy great explanation,thank you
the way you explain react is the best!
Thanks for the video bro. Simplified explanation always makes understanding better 😊
Glad you found it useful!
Yes Indeed. Keep it up 👏
Crystal Clear... Thanks
A really underrated channel, well done bro! ⚡❤
thanks man I really understood it. Subscribed already
best explanation ever!🤩
great explanation. I was a little bit confuse when using context and how to implement them.
Amazing Channel for Learning React
you made it soooooo easy to understand
Bro I love the way that you explain keep it up. Subscribed❤
Great, thanks. It's my first Context video and I think I got it at the first time because it's so well explained, of course having used Redux before makes this easier to understand.
glad to hear it!
Amazing channel, thanks.
Great content, thank you!
"If you watch this hook video, you'll probably never need to watch another"
This is so true! You explain it so well. Thank you!
Thanks man! Crystal clear now!
trying to get a grasp of it,nobody taught like u did,i finally get it now ❤❤
🤙
I reall like this explanation. You're very good, god bless you!
Top-notch explanation. Manifesting 100k subscribers by end of this year
Thank you very much. Good content
great explaination on useContext
great explaination thank you bro!
That was such an awesome explanation 👍
Thanks 🤙
Really use full video thanks for doing ... extending my great full and encouragement .... keep doing well..
Context API with a custom hook, so well explained. Thank you.
{2023-10-16}
Thanks a lot, this was really helpful. Really great video and great channel
glad it helped!
Great video, thanks for sharing your time and knowledge,
I literally subscribed after seeing your message in the Video
useContext is a great alternative for a bunch of prop drilling with a bunch of useStates as well in the child component as well.
1:31 This part of the code worked; I have now subscribed!
☺️
No doubt I won't need to watch another React Context API video! [Subscribed]
Top notch! You're the man
You're the best man
Cosden. I love you bros 😉
man, awosome video crystel clear concepts and learned how to write a more safe code(in the pov for debugging)
Home of React well explained Tutorials
thanks . helped a lot
That subscribe intro you did made me subscribe. Genius.
i put like b4 watching your videos :)
legend
Thank you bro!
please keep it up with more hooks and thank you !
Will do!
I speak another language, but I'm happy to find this video. Thanks!
Working on adding translated captions to all videos soon!
loved ur react tuts.... 🔥🔥🔥🔥🔥🔥🔥🔥
I watched many videos and still did not understand context but this video helped me a lot.
you got this
I really did subscribe at 1:57...good one there😂
Sou desenvolvedora Júnior e seus vídeos estão me ajudando muito a me desenvolver 🚀
Thanks, man very good video. 10 Stars ⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Nice video!
Thank for this
I made an instant subscription 👍
🤙
Thanks a lot.
Great example!!!
It would be suggested to put some console log and also the UI just to make it more clear would be a lot helpful too thanks
GOD level explanation. I want everyone to subscribe to this channel. Too bad one can't give two likes.
Thanks from india..
Just make more videos like this on react plz you explain really well
Will do!
And what if User comes from a fetch? Do you put in on the custom hook? How would you handle errors? Thanks for the video
If user come from server state, don't throw error in custom hook, just return user.
grouse wrapping the context in a hook. You can build up the provider with state & mutators and pass that to the value of the provider. There's no need to wrap the context with hook jank to extend the context -> with a wrapped hook A) you're not enforce access & mutations B) you also have an extra shit tonne of renders as the hook runs through state changes in every component C) you remove the useContext which hides the fact the component is consuming global/shared state.
realy thank you but i have a question please which better using context api or redux tookit
Great tutorial thanks. My subwoofer got a serious workout every time you banged the mic though :-)
LOL 😂 it gets better in later videos I promise!!!
Thank you
Thanks 🙏😊
Thanks for making in ts
Thanks for the reminder to subscribe. Guilty as charged, but subscribed now.
thank you
now i subscribed ;)
This was a really good explanation. Would you consider doing a video about useContext in regards to forms?
sure!
@@cosdensolutionsI get stuck on passing input content to the page. Trying different ways without too much success.
Cant subscribe but here is my thumbs up 👍