👉 Source code & PPT access Free: github.com/thapatechnical/react-19-series-thapa-technical 👉 Here is the Complete Playlist: ruclips.net/p/PLwGdqUZWnOp1Rab71vx2zMF6qpwGDB2Z1
Watched a lot of react tutorials on youtube but noone ever explained this point. Thapa is expaining each snd evry details. This video deserves the caption world best react series.
Nice video and In short - React does not call useState while updating the state. UseState get called only on mounting not on updating. For update life cycle we have setState.
the reason the value is not resetting on each render is that you're using React's useState hook, which preserves state across renders. This behavior is by design, as React hooks maintain state between renders, ensuring that when the component re-renders (for instance, after a state update), the value does not reset to its initial value. Here's a simplified breakdown of what's happening: 🚀Initial render: value is 0 (the initial state). 🚀You click the button, triggering setValue(value + 1). 🚀React re-renders the component but remembers that value was updated to 1 (or the next value), so it uses this new value. 🚀This process continues for every click, maintaining the updated state across renders. 🚀That's why your value is not resetting to 0 upon re-renders.
vai actually ham jo react documentation se sikhe he udhar aisey hi sikhaya gaya hai ki first click pe state change hota hai 0 to 1 then initial change ho gya aur is time pe prir se click karnese previous bala hi inertial count hua hai aur oske badh 1+1 = 2 ho jata hai
npm error } npm error npm error The operation was rejected by your operating system. npm error It's possible that the file was already in use (by a text editor or antivirus), npm error or that you lack permissions to access it. npm error npm error If you believe this might be a permissions issue, please double-check the npm error permissions of the file and its containing directories, or try running I got this error after installing bun
Its much harder to understand this in functional components as they see that there is a line of code written then why doesn't it affects ? Actually the best way to show this could be using class components or via a diagram that how it works. There is one more way (just for understanding) that the hook name is useState not createState (even though hook names always start with 'use') but still with it you can imagine. Someone could imagine useState means I want to use a state, If this state already exists, give me its value or create it with the initial value I passed in.
Even though video is good, still I would like to mention a point. He said the initial value is used only for the first time and he is right upto some extent but not always true. If the component is removed from tree, its state is deleted as well. So when it again is added to tree, it will use the initial value. You could create an example using a simple switch/checkbox which will ONLY render the counter component when its checked i.e render conditionally. I am NOT saying about hiding and showing the component using styling, but actually rendering conditionally
Ek minute Mai bhi btaya ja shkta tha video timing short krden but aise videos boring ja rhi hai video short krden or topic zada 30 minutes max ki toh bnayen lzmi
👉 Source code & PPT access Free: github.com/thapatechnical/react-19-series-thapa-technical
👉 Here is the Complete Playlist: ruclips.net/p/PLwGdqUZWnOp1Rab71vx2zMF6qpwGDB2Z1
Interesting
2 Video daily... Please
sir ppt is not avalable on github
Watched a lot of react tutorials on youtube but noone ever explained this point. Thapa is expaining each snd evry details. This video deserves the caption world best react series.
Most effective sir
Nice video and In short -
React does not call useState while updating the state.
UseState get called only on mounting not on updating.
For update life cycle we have setState.
Big Fan sir...
Kindly
material UI or react dono peh project banayein
Nice explanation ❤
thank you for this video it's helps me a lot
Awesome
Good Series.👍👍
amazing sir.
Amazing video 👏🏻
Thanks Sir👍
Thanks
amazing sir
Bhaiya node js ka bhi bnaya sath sath me
bhai sare hook ka funda clear karouge kya ?
Sir Redux Thunk Full Course In Hindi Please
the reason the value is not resetting on each render is that you're using React's useState hook, which preserves state across renders. This behavior is by design, as React hooks maintain state between renders, ensuring that when the component re-renders (for instance, after a state update), the value does not reset to its initial value.
Here's a simplified breakdown of what's happening:
🚀Initial render: value is 0 (the initial state).
🚀You click the button, triggering setValue(value + 1).
🚀React re-renders the component but remembers that value was updated to 1 (or the next value), so it uses this new value.
🚀This process continues for every click, maintaining the updated state across renders.
🚀That's why your value is not resetting to 0 upon re-renders.
Nice video bro
aysa saval hamne khabhi nahi saocha
😅
vai actually ham jo react documentation se sikhe he udhar aisey hi sikhaya gaya hai ki first click pe state change hota hai 0 to 1 then initial change ho gya aur is time pe prir se click karnese previous bala hi inertial count hua hai aur oske badh 1+1 = 2 ho jata hai
@@xyonxyt9170 actual truth
awesome
How are you using components in console window???
Can you tell us what command we have to use to check as you are checking UI.
install react dev tool extention.. u can see the component structure in console
Bro is this react is full course for beginners ????
yes
100%
npm error }
npm error
npm error The operation was rejected by your operating system.
npm error It's possible that the file was already in use (by a text editor or antivirus),
npm error or that you lack permissions to access it.
npm error
npm error If you believe this might be a permissions issue, please double-check the
npm error permissions of the file and its containing directories, or try running
I got this error after installing bun
Chat GPT se solve krwa lo
Npm hi use kro.. Bun nhi
Its much harder to understand this in functional components as they see that there is a line of code written then why doesn't it affects ? Actually the best way to show this could be using class components or via a diagram that how it works. There is one more way (just for understanding) that the hook name is useState not createState (even though hook names always start with 'use') but still with it you can imagine. Someone could imagine useState means I want to use a state, If this state already exists, give me its value or create it with the initial value I passed in.
Even though video is good, still I would like to mention a point. He said the initial value is used only for the first time and he is right upto some extent but not always true. If the component is removed from tree, its state is deleted as well. So when it again is added to tree, it will use the initial value. You could create an example using a simple switch/checkbox which will ONLY render the counter component when its checked i.e render conditionally. I am NOT saying about hiding and showing the component using styling, but actually rendering conditionally
How to get Components in my Inspect as shown at 0:50
GOOD JOB❤
Nice sir ❤
bhai sabhi hook shikha na please mai apke sath start se hu
Ek minute Mai bhi btaya ja shkta tha video timing short krden but aise videos boring ja rhi hai video short krden or topic zada 30 minutes max ki toh bnayen lzmi
Api base project
thanks