How to Track Previous State in React
Explaining how to track previous state in React using refs and effects, optimising to use only state, then extracting the logic to a custom hook
Tags: react, hooks