Executing async code on update of state with react-hooks
useState setter doesn’t provide a callback after state update is done like setState does in React class components. In order to replicate the same behaviour, you can make use of the a similar pattern like componentDidUpdate lifecycle method in React class components with useEffect using Hooks useEffect hooks takes the second parameter as an array … Read more