Cory Dransfeldt

5 days ago

React useState with Callback

robinwieruch.de

If you have started to use React’s useState hook for your application, you may be missing a callback function, because only the initial state can be passed to the hook. In React class components, the setState method offers an optional second argument to pass a callback function.