This blog assumes that you know the fundamentals of react like Component, Props and jsx. TL;DR useState() returns 2 values, 1st is a value that will persist across renders and 2nd is and API to update that value and trigger a re-render. const [per...
shubhs.hashnode.dev8 min read
Pls make the same post about different hooks also
Wonderful Shubham! I understood some of my mistakes I did. The way you present things is very catchy 👍
nice article man,
I am just learning react atm, and I kinda have a smaller more easier understanding to this.
If you are familiar with 'getters' and 'setters' its pretty much that. just, the useState(<value>) is the function which we are passing in the values to. the first one being the state we wish to affect and the second being a setter method for that namespaced state so we can affect its value...const [value,setValue] = setState(<default value>)
If I am wrong please let me know. Nothing worse that thinking something to be right when it was wrong in the first place.
Jay Panchal
DevOps Engineer | Containerization, Automation and Cloud
Aa to vachelo che. Maal lakhyo