Tyler Hawkins
Jan 19, 2021

--

Hey DsEsteban, sure thing. I have a demo repo on GitHub with some examples here: https://github.com/thawkin3/react-component-state-demo

And you can see the live demo here: http://tylerhawkins.info/react-component-state-demo/build/

Take a look at the function component example for "BAD: Don't set state that relies on the previous state without using the function of previous state", and then compare that to the behavior you see in the next example "GOOD: When setting state that relies on the previous state, do so as a function of previous state".

Hope that helps!

--

--

Tyler Hawkins
Tyler Hawkins

Written by Tyler Hawkins

Staff software engineer. Continuous learner. Educator. http://tylerhawkins.info

No responses yet