Your all english and bangla programming content explanation is awesome , i never seen this type easy explanation video anywhere, you are my guru. take love dada❤
Quality content! i havepurchased a react course on Udemy and i have finished basics and useState but when i found your videos i first watched all your videos then im going back to udemy course!
You're really good at teaching and explaining very detailed things simply. Subscribed to your channel. Hope to learn more from you and follow your footsteps
Instead of using Math.random() method to change the color, I initialized an array with a couple of colors, declared a variable i= 0, outside the component and upon clicking the button we are setting the color to setColor(colors[i]) and at the same time incrementing the 'i' variable value in the changeColor function. I am able to change the color to the color values given in an array. As I initialized the 'i' variable outside the component I am able to change the color to all the color values of that array. Anyhow thanks for clarifying my doubt Sir. It helped me a lot to understand the concept and revive the things again.
Great videos. Have learnt something new in every video. Very high quality - which is not found even in good Udemy courses. Explains the key points in a very good manner.
Here are some key points from the video: useState is a React hook that allows you to declare and track state variables in your components. You can initialize state with a value or a function. The function that you pass to useState will be called only once at the first render of the component. You can use the set state function to update the state of your component. The set state function takes a callback function that can access the previous state value. You can use the useEffect hook to perform side effects in your components
I think you meant to remove setCounter(counter + 3) before executing your final incrBy3 code. Might be interesting to put in a sleep an interval or something to spoof a long-running process and show how prev works in a threaded environment?
please correct if i am going wrong lazy initialize is about adding function in useState( ) and also like you give 28:13random computation in useState(), wouldn't it be high computation at intial ? should we avoid it if high computation?
Yes lazy initialize is by passing a function to the useState. That's right. If some computation that is time taking or performance intense, and they need only once initially on component load, you can execute them lazily with useState for initializing state value. The component rerender will not impact that way as every next render the heavy computation will not take place. On the other hand, if you execute the high computation function outside and pass the return value to useState, the function executes on every render. I hope it is clear now.
The function we pass in the setState() method is a call back function that takes an argument. The argument name can be anything, prev, previous, last, even tapas :) The useState hook will take care of assigning the previous state value to that argument of the callback function so that, when we execute setState() we have an opportunity to use that. I hope it is clear now?
Inorder to have an old reference for the virtual dom to compare while updating the state, we are using this setState method in useState hook. Is it right Sir? I am not able to get this part of updating the state directly or indirectly. Updating the state directly means changing the state variable value without using any function or without creating any instance. Is it true sir my understanding on this concept of useState hook?
Updating the state directly means mutating the state variable directly. Doing this, React will not initiate the rerender of your component. Hence you will not see the state value changes reflected in JSX. You must use the setter function that React provides you.
Your all english and bangla programming content explanation is awesome , i never seen this type easy explanation video anywhere, you are my guru. take love dada❤
@@sonatanpaul take love ❤️ ❤️❤️
18 days gap between last video and this video! please upload more frequent
I wish 😀
Quality content! i havepurchased a react course on Udemy and i have finished basics and useState but when i found your videos i first watched all your videos then im going back to udemy course!
Thanks Raj for your comments. I wish you a happy learning 🙌
I am not exaggerating but first time I understood the use state hook and you cleared my all doubts.
Then you will like the JS fundamental videos too.. The next video coming tomorrow
@@tapasadhikary Sure sir
thanks sir for making video your jsx video really helped me lot sirr plzz continue react series doont stop
Good to know, Prathamesh. No intention to stop 🚀
Great Video Tapas.
Waiting for next one.
You are welcome
Amazing content as always sir - love from Pakistan😍😍
Thanks a lot.
This is so informative. Learnt so much ..thanks for keeping it simple and to the point
You are welcome 🙏
You're really good at teaching and explaining very detailed things simply. Subscribed to your channel. Hope to learn more from you and follow your footsteps
Thanks a lot.
Instead of using Math.random() method to change the color, I initialized an array with a couple of colors, declared a variable i= 0, outside the component and upon clicking the button we are setting the color to setColor(colors[i]) and at the same time incrementing the 'i' variable value in the changeColor function. I am able to change the color to the color values given in an array. As I initialized the 'i' variable outside the component I am able to change the color to all the color values of that array. Anyhow thanks for clarifying my doubt Sir. It helped me a lot to understand the concept and revive the things again.
After long time finally new video :)
thank you !!!
Thank you! Yeah after a couple of weeks break 😀
Fantastic video Tapas!
Thanks! 🔥
So much clarity, thank you so much!
You are most welcome.
Great videos. Have learnt something new in every video. Very high quality - which is not found even in good Udemy courses. Explains the key points in a very good manner.
Hello Vishal. I'm very glad to hear that. Thanks for your support and kind words 🙏
Here are some key points from the video:
useState is a React hook that allows you to declare and track state variables in your components.
You can initialize state with a value or a function.
The function that you pass to useState will be called only once at the first render of the component.
You can use the set state function to update the state of your component.
The set state function takes a callback function that can access the previous state value.
You can use the useEffect hook to perform side effects in your components
nice explanation
Welcome 🤗
thanks now usestate is clear to me
Hello Naunihal, good to know. Thank You!
Thank you Sir ☺️
You are welcome 💙
Great tutorial!!!
Thanks a lot 💙
I think you meant to remove setCounter(counter + 3) before executing your final incrBy3 code.
Might be interesting to put in a sleep an interval or something to spoof a long-running process and show how prev works in a threaded environment?
Yep, right. It will be interesting.
please correct if i am going wrong
lazy initialize is about adding function in useState( )
and also like you give 28:13random computation in useState(), wouldn't it be high computation at intial ? should we avoid it if high computation?
Yes lazy initialize is by passing a function to the useState. That's right.
If some computation that is time taking or performance intense, and they need only once initially on component load, you can execute them lazily with useState for initializing state value.
The component rerender will not impact that way as every next render the heavy computation will not take place.
On the other hand, if you execute the high computation function outside and pass the return value to useState, the function executes on every render.
I hope it is clear now.
Tapash vai where i can use the next setCounter with prev state please give me an example
but we haven't initialized prev anywhere...how does it know it is previoUs value
The function we pass in the setState() method is a call back function that takes an argument. The argument name can be anything, prev, previous, last, even tapas :)
The useState hook will take care of assigning the previous state value to that argument of the callback function so that, when we execute setState() we have an opportunity to use that. I hope it is clear now?
@@tapasadhikary yes sir I got it because of it is declarative
Inorder to have an old reference for the virtual dom to compare while updating the state, we are using this setState method in useState hook. Is it right Sir? I am not able to get this part of updating the state directly or indirectly. Updating the state directly means changing the state variable value without using any function or without creating any instance. Is it true sir my understanding on this concept of useState hook?
Updating the state directly means mutating the state variable directly. Doing this, React will not initiate the rerender of your component. Hence you will not see the state value changes reflected in JSX.
You must use the setter function that React provides you.
@@tapasadhikary Thanks a lot Sir for clarifying the doubt.
Using the same name sometime sounds confusing, colorizer name for component, div class name, also the div content.
32:12 minutes worth watching the vdo.
Great 🙌
React hooks start with useXXX and are reusable components to fetch data,DOM manipulation
Right...