Tyler Hawkins
1 min readSep 16, 2020

--

Almost! If you need to run a side effect after the state has been updated, then you should use a callback and run your side effect code inside there.

Since React uses a declarative programming style, you don't need to manually (or imperatively) update the DOM after a state update. React components are just functions of props and state, so after a state change the component will update the UI for you automatically!

--

--

Tyler Hawkins
Tyler Hawkins

Written by Tyler Hawkins

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

No responses yet