Learn useContext In 13 Minutes

Learn useContext In 13 Minutes

Web Dev Simplified

3 года назад

686,229 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@paitrex
@paitrex - 16.12.2023 15:18

Why do we need a 2 components (theme context. Provider and theme update context. Provider) inside a theme context. Js?
Cannot we use just one? Why?

Ответить
@Amarnath62627
@Amarnath62627 - 12.12.2023 13:20

Don't watch this video if you don't know nothing about the useContext. It will make you so confused.

Ответить
@yubrajkhatri3519
@yubrajkhatri3519 - 06.12.2023 12:32

i am following the full playlist of hooks and i have no idea how the level suddenly up like that drastictally

Ответить
@dimitrioszygolanis
@dimitrioszygolanis - 06.12.2023 10:42

In order to simplify it, I think you could create an object, like const values = { darkTheme, toggle } and pass both values inside the ThemeContext.Provider, in order to avoid creating 2 providers.

Ответить
@jawedpoya3453
@jawedpoya3453 - 05.12.2023 18:00

Hello, Genius bro I love your way of working with JS.
From Afghanistan .
Thank you so much.

Ответить
@GroovyMMA
@GroovyMMA - 28.11.2023 13:41

why did you need to create 2 context providers, wasn't it possible to pass darktheme and a toggler function though one context provider in the value?

Ответить
@mrluckyuncle
@mrluckyuncle - 25.11.2023 07:40

You're great :-) Excellent, clear explanation, and I was able to put it to use right away.

Ответить
@chiderathankgodobed4496
@chiderathankgodobed4496 - 20.11.2023 12:36

Whenever I need a quick,simplified overview of anything programming, KYLE is my guy, his job is to SIMPLIFY THE WEB FOR ME

Ответить
@aaqibhamdule73
@aaqibhamdule73 - 14.11.2023 13:08

isn't useUpdateTheme context and overkill ?

Ответить
@aaqibhamdule73
@aaqibhamdule73 - 14.11.2023 13:08

what's the point of putting the implementation of dark theme in Functional Component .
Shouldn't the background colour be passed on to wrapped components from the provider

Ответить
@doomer1
@doomer1 - 09.11.2023 10:55

I literally find redux easier to wrap my head around. It's more difficult to verbose but much more logical and easier to understand.

Ответить
@ShiverShOcK
@ShiverShOcK - 05.11.2023 21:42

Thank you very much for the Video. I think it is still quite ugly with the two wrapping provider... Vue have got definitly cleaner solutions.

Ответить
@tahasoft1
@tahasoft1 - 13.10.2023 18:07

You have great content, but please stop repeating "my name is and ...." in the introduction every video.
I'm thinking about making a chrome extension to auto-skip first minute of any video I open from your channel

Ответить
@thecuriouskid3606
@thecuriouskid3606 - 09.10.2023 06:00

Btw you could've used a single custom hook for everything here. You could have passed the context as an object like themeData = {darkTheme: darkTheme, toggleTheme: toggleTheme} and then use them in there like ThemeContext.darkTheme and ThemeContext.toggleTheme instead of wrapping the child with two providers.

One provider but carrying the data with in an object and you can even call the function using that.

Ответить
@hugooliveirapinho9218
@hugooliveirapinho9218 - 07.10.2023 08:31

perfect explanation! thank you very much!

Ответить
@LoganPL100
@LoganPL100 - 02.10.2023 20:57

so if I want to add, let's say switch for toggle shadow on/off, I need to create provider for value (true/false) and provider for toggle function and nest them? if we have more contexts {children} will be in nest hell

Ответить
@user-xw2ut5eb5g
@user-xw2ut5eb5g - 20.09.2023 10:39

you're cute makes me watch more of your content, even though its outside of my topic to be learn hehe.

Ответить
@yotonking2831
@yotonking2831 - 04.09.2023 19:06

Usually your videos are easy to understand but this was too complicated for no reason. I watched Ben Awad's video about this and I immediately got how to do it. I recommend everyone watch it instead.

Ответить
@AmanMavi1
@AmanMavi1 - 04.09.2023 09:47

guess i need to see this video 2-3 times to actually understand it

Ответить
@rashikraj7404
@rashikraj7404 - 16.08.2023 09:24

This was a really good tutorial!

Ответить
@Ai-HealthEdu
@Ai-HealthEdu - 14.08.2023 08:42

had to watch 4 times in order to learn

Ответить
@wasimnadaf11
@wasimnadaf11 - 01.08.2023 20:54

Ver clearly explained. The concept is really drilled into my mind. thank you for this amazing video

Ответить
@kostiantynkarzhanov9216
@kostiantynkarzhanov9216 - 20.07.2023 06:00

Very good and consise explanation! Thanks for one more awesome tutorial!

Ответить
@vehktaur
@vehktaur - 12.07.2023 15:56

I actually needed this tutorial on a project i was working on that also involved switching theme from light to dark mode and vice versa so this fit my need perfectly.
the second half of the video was really confusing tho

Ответить
@ViniciusSantana5581
@ViniciusSantana5581 - 06.07.2023 11:02

@WebDevSimplified Great explanation. I'm curious on why you choose to create 2 contexts in ThemeContext Component (ThemeContext and ThemeUpdateContext) over having one context with the ThemeContext.Provider taking as value both darkTheme and toggleTheme in either an Object or Array. Something like <ThemeContext.Provider value={{isDarkTheme, toggleTheme}}.

Ответить
@shwetankmishra
@shwetankmishra - 06.07.2023 09:48

im mentally unstable now

Ответить
@deogenesabejuela7016
@deogenesabejuela7016 - 06.07.2023 05:02

Good tutorial, but very quick lesson for a beginner like me in Reactjs. if you will just make it a little slow, Your tutorial is amazing. Anyway i was able to get the concept of your tutorial but as i said, My only comment is, it so fast. For beginners i doubt if they will get it. :-)

Ответить
@rishisetpal3537
@rishisetpal3537 - 05.07.2023 07:45

Kyle Thanks for your Guidance

U helped us to learn
How to create Context: const AnyContext = React.createContext()
How to Provide value from the Context to all Children: AnyContext.Provider value={anyState}

In Advance Section of creating SeperateContextComponent where we have all Context Related stuff
But, We only got to know how it works with Functional Component
What about Class Components?

AnyOne ?


Also, how can we work with data updating like strings, lists and objects???

Ответить
@user-rw2wr9ul5s
@user-rw2wr9ul5s - 03.07.2023 08:03

But you should begin by explaing why you are using context in the first place. What problem does context resovles?

Ответить
@smartcoderz6055
@smartcoderz6055 - 01.07.2023 20:03

What's the difference between props and useContext by the way? you can pass that theme toggler by props too

Ответить
@sebastiantamayopacheco4194
@sebastiantamayopacheco4194 - 29.06.2023 19:39

God bless you man great videos

Ответить
@ashutoshpatel5030
@ashutoshpatel5030 - 23.06.2023 19:23

first half was smooth ....and during second half my ride started shaking 🥴🥴⚰⚰⚰⚰

Ответить
@PatrikRasch
@PatrikRasch - 19.06.2023 23:08

Good stuff, great to get a deeper understanding of stuff I learn from The Odin Project from you on here!

Ответить
@timothylander3469
@timothylander3469 - 18.06.2023 14:15

After watching the entire video once, then duplicating the project during a second viewing, I was able to understand the concepts well enough to add additional context variables and new sibling components that can easily communicate amongst themselves. Your explanations, demos, and walk-throughs are so clear, concise, and to-the-point that with some study, the concepts really begin to sink in. Thank you!

Ответить
@max4865
@max4865 - 16.06.2023 03:22

immaculate

Ответить
@rahulchowdhury4227
@rahulchowdhury4227 - 14.06.2023 09:06

Man so easy and convenient.

Ответить
@user-rw4vv4wz3v
@user-rw4vv4wz3v - 13.06.2023 12:33

why should we use theme update ocntext insted of passing an object or array as value of ThemeContext ??

Ответить
@zevspitz8925
@zevspitz8925 - 07.06.2023 12:31

A gentle introduction to useContext and context in general. Two points:
As others have noted, I would have a single provider for both the darkTheme and toggleTheme values.
Also, I found it confusing that the button now has to live within the FunctionComponent. I'm not sure which is better: wrap the App component in ThemeProvider one level up, or create an intermediate component to hold the button and the FunctionComponent.

Ответить
@HrissW
@HrissW - 04.06.2023 16:13

Zone out after 5 min 😥

Ответить
@sahilsharma1inspirationalTape
@sahilsharma1inspirationalTape - 30.05.2023 10:47

you again proved that this is a channel is a dustbin not more than that

Ответить
@MoiseMUHIRE-op9md
@MoiseMUHIRE-op9md - 21.05.2023 03:35

I like when kyle say my job is to simplify web dev for you so you can start build your dream project sooner❤❤❤

Ответить
@lacucaracha7546
@lacucaracha7546 - 19.05.2023 04:40

ludwig

Ответить
@VeerapatBoonkerd
@VeerapatBoonkerd - 18.05.2023 08:09

too complicated to demonstrate example dude.

Ответить
@tarunsaxena8306
@tarunsaxena8306 - 04.05.2023 08:14

An important note: try to avoid circular dependency

Ответить
@ademolaqueensley7908
@ademolaqueensley7908 - 03.05.2023 02:35

for a beginner, i am more confused than ever

Ответить
@toohee8561
@toohee8561 - 30.04.2023 04:45

Look forward for your courses Kyle!

Ответить
@varundoshi5136
@varundoshi5136 - 09.04.2023 19:18

This channel literally has everything that I search for. Can't thank you enough for sharing your knowledge!

Ответить