Informational, straight to point, friendly, and motivational. I really like how you give us your honest opinion near the end based on your experience. It helps us learners because we are overwhelmed by so many things to learn from. Now I am going to watch your hooks video. Thank you again.
Hi Pedro. Really nice, as always. I really liked your video on "4 types of Fetch" because you divided that into different files like it would be in production. Here at 8:20 you're saying "And obviously I'm doing it in one file. But imagine how it would look if you separate that to more files". Please: these people (myself partly included) which are watchich these beginner videos have almost certainly a problem to see how it would work with imports and so on in those separate files. So my tip for next time, show it in one file, no problem, but then, for 5 seconds (at the end for example) show it separated to more files with good file names and file structure. Nearly all internet tutorials, for "simplicity" are showing everything in one file.... Be different! Be closer to production! Like you were in "4 types of Fetch video" :-)
Good stuff here. I appreciate how the downside of context management is underscored. One really needs to think about state, but also the way the state changes.
If you try to pass a null value into a createContext while you are using Typescript it will throw a warning. Yeah, you can change your tsconfig to ignore this (ignore null checks). There is a workaround, can't remember it at the moment -- but I figure I share this for the TS guys who might be watching this video while working LOL.
Yes! I use typescript at my job and on side projects, what I do is I create an object called `defaultValues` and also specify the format of the context with an interface
@@PedroTechnologies Sounds about right. I have worked on some code bases were I think we did something like that with an initial state or like this (been a while) const authContext = useContext({} as AuthContextType) the context type being an ts interface or however we did it I forgets and am too lazy to go back and look =)
A quick question: the re rendering is really a drawback the re rendering is a misunderstood feature of context? I mean, the name itself says, context. Is a thing to wrap components inside to warn these components, like: "hey, the state you want to show changed, so let's re render".
You know you are just explaining to yourself, and do not mind that the viewer does not have the ideas of what you are saying so you should show what you are saying. Remember the point is you are here in order to be understood.
the changes made to this context object does'nt re-render the child components , you're passing the setUsername as a reference to the value prop, the reason why it is re-rendering is , you're making changes to the state by passing its setUsername reference and offcourse if a state in parent component changes the child component is re-rendered. Context API changes doesnt re-render it's child components.
Wrapping multiple components with context will turn into a big mess the bigger the app gets. It’s good to know, but I would never use it, there are just too many better options.
yo pedro, I create ContextProvider for socket io and use it for layout in react-router-dom element and use Outlet as a children inside that ContextProvider is that okay? previously I use builtin useOutletContext hooks provided by r-r-d but I have nested protected route so its throw and error.
You can put them where ever you want! You could do it like this if you want to access all the data from each provider everywhere in the app. But you can also put providers inside of the app so that the data is only accessible inside of a group of components
So I planned to watch the video on the series of your react tutorials but this on is more longer so im going to start with these. I wanted to give you a gift but dont know how to contact you
im really struggling to stop avoid unnecessary rerenders when using context api, you gave me the idea on how should i fixed it, thanks man
Thank you for taking the time to give drawbacks and opinions and your preferred method. It really made it easy to wrap around broad concepts.
Great video. I like how you didn't just explain how to implement context, but also revealed the drawbacks and mentioned where to use it.
Your knowledge was always incredible. Now your video graphics and etc. are also evolving... Great effort
Appreciate it! Happy to see u are liking the videos :)
I really appreciate how balanced and informative this is . Great delivery and excellent content.
Informational, straight to point, friendly, and motivational. I really like how you give us your honest opinion near the end based on your experience. It helps us learners because we are overwhelmed by so many things to learn from. Now I am going to watch your hooks video. Thank you again.
Hi Pedro. Really nice, as always. I really liked your video on "4 types of Fetch" because you divided that into different files like it would be in production. Here at 8:20 you're saying "And obviously I'm doing it in one file. But imagine how it would look if you separate that to more files". Please: these people (myself partly included) which are watchich these beginner videos have almost certainly a problem to see how it would work with imports and so on in those separate files. So my tip for next time, show it in one file, no problem, but then, for 5 seconds (at the end for example) show it separated to more files with good file names and file structure. Nearly all internet tutorials, for "simplicity" are showing everything in one file.... Be different! Be closer to production! Like you were in "4 types of Fetch video" :-)
Totally agree on this!!
Nonsense. The one file approach did a great job in showing the prop drilling tendency in React. Make your own videos before handing out 'tips'.
@@jaimemedina3351 😂Nothing wrong with suggestions. I am sure the creator appreciates the suggestion.
Good stuff here. I appreciate how the downside of context management is underscored. One really needs to think about state, but also the way the state changes.
If you try to pass a null value into a createContext while you are using Typescript it will throw a warning. Yeah, you can change your tsconfig to ignore this (ignore null checks). There is a workaround, can't remember it at the moment -- but I figure I share this for the TS guys who might be watching this video while working LOL.
Yes! I use typescript at my job and on side projects, what I do is I create an object called `defaultValues` and also specify the format of the context with an interface
@@PedroTechnologies Sounds about right. I have worked on some code bases were I think we did something like that with an initial state or like this (been a while) const authContext = useContext({} as AuthContextType) the context type being an ts interface or however we did it I forgets and am too lazy to go back and look =)
Awesome video Pedro, thank you so much for the knowledge shared.
Bruh, you're a life saver
This video is a lifesaver, thanks a bunch!
Thank you Pedro for this one. It came at the right time for me.
i have the same feeling about redux and graphQL xd amazing video, subscribed ! great job
perfect- i just wanted to look into the context API :) u helped me with redux so im looking forward to context api
A quick question: the re rendering is really a drawback the re rendering is a misunderstood feature of context?
I mean, the name itself says, context. Is a thing to wrap components inside to warn these components, like: "hey, the state you want to show changed, so let's re render".
Love your video man, thanks so much for the info!
Good timing, I needed this.
THANKS! Was very informative and helpfull
you are the next web dev simplified i swear
Great stuff as always. I pretty much use Zustand for everything these days.
Is Zustand any good
@@SahraClayton i like it a lot. It’s simple and no boilerplate as rtk
Thanks for the video, helped me understand the context API
I loved the way you explained.
Thanks pedro .. really need this tutorial hope you make next.js typescript tutorial
Thats why i really like the vue team . They created pinia, and it has the solutions embeded in one solutions.
Yeah. Hope pinia isn't tied to vue though
Really informative content. I love your suggestions where and when.
Can you also make a video on best practices on react app file structure. and styling please
great video. thanks man
You know you are just explaining to yourself, and do not mind that the viewer does not have the ideas of what you are saying so you should show what you are saying. Remember the point is you are here in order to be understood.
Very Helpful. Thanks
Love the content!
Thank you for teaching me this stuff...
Voce eh incrivel!!! Adoro seus videos :D
great video and explanation
Excellent video.
You rock ! Thank so much
Hello bro please make complete FIREBASE REACT VIDEO INCLUDING ALL
Thanks Pedro
Thanks!
Thank you for the support!!!
let me watch this one, i always learn a lot on this platform
Thanks for this!
the changes made to this context object does'nt re-render the child components , you're passing the setUsername as a reference to the value prop, the reason why it is re-rendering is , you're making changes to the state by passing its setUsername reference and offcourse if a state in parent component changes the child component is re-rendered. Context API changes doesnt re-render it's child components.
This was helful!
very well explained
Great video 👊
thanks. it helped alot
Thank you :)
Olá Pedro! Vc tem conteúdos com typescript?
Wrapping multiple components with context will turn into a big mess the bigger the app gets. It’s good to know, but I would never use it, there are just too many better options.
I agree! Thats why i try to use React query + composition in most cases. And use the context api for general states that are rarely mutated.
How do you install it?
Hey Pedro! Thanks for the video. What VSCode theme are you using? I love it!
dracula
Im just getting back to react. Why not use redux for this kind of problems?
When to use redux toolkit and when to use context api?
ty bruu
well i understand what you tried to tell so now please make a tutorial on REDUX
He already has a tutorial on redux... well detailed
Could you please talk about RxJs or reactive state managment?
Do you have any video on react native?
yo pedro, I create ContextProvider for socket io and use it for layout in react-router-dom element and use Outlet as a children inside that ContextProvider is that okay? previously I use builtin useOutletContext hooks provided by r-r-d but I have nested protected route so its throw and error.
Could you add the starting code also, so that we can follow along from the beginning?
i am terribly confused why he call child compoenet if he can directly call grandchild
if I use several providers. where I should put them please. like this?
thanks a lot
You can put them where ever you want! You could do it like this if you want to access all the data from each provider everywhere in the app. But you can also put providers inside of the app so that the data is only accessible inside of a group of components
@@PedroTechnologies thank you so much :) god bless you 🙏🙏
Thanks bro it heled me a lot. thanks a lot bro my sweet bro
thanks a lot 🙏🙏
Thanks bro
Great Content
We need tutorial on REDUX with react
Could you make Relay tutorial please
Thanks
excelente video
React native !!!!!!!!!!!!!!!!!!
So I planned to watch the video on the series of your react tutorials but this on is more longer so im going to start with these. I wanted to give you a gift but dont know how to contact you
watched and finished almost the hole series
You can send some money to him
nice video
❤️❤️❤️
what are children and why are they passed as props
Badly explained
Thank you, Pedro! The way you explain makes everything super easy! Go Brazil 🟢🟡🔵
Download SUBSGAIN App from play store
Amazing video