
React Component and State Management - JSJ 526
JavaScript Jabber
00:00
Using a Setter Function in a Component Function
The component function uses the current state value to render the ui. It also, as i said, often associates event handlers with the elements in that i. The second element is a setter function very similar to the said state that we previously saw with classes. And it's used to update that specific value. So you would potentially use use state multiple times within that same component function. Each one of them, youwould get back the current value and s and a set state for that specificvalue. Now suppose we want to stor at, say, three values instead of just one. Well, the easiest solution is to simply call you stateThree within the same functions. But does react
Transcript
Play full episode