React hooks provides the possibility of mimicking the lifecycle method componentDidUpdate
with useEffect
without dependencies:
useEffect(() => {
// componentDidUpdate
});
How can I detect if some prop is GOING TO update with react hooks?
I need to execute some code right before some changes.