You need Login/Signup to run/submit the code.
useEffect is a very useful hook. It works similarly to the
componentDidUpdate() methods for class components.
However, sometimes, we want to execute the hook only when the component updates.
In this question, you need to solve this particular problem only. You need to implement a custom hook called
useDidUpdate that takes a
dependency array as parameters. It only invokes the callback whenever the dependency array changes i.e. component updates.
callback: Function: The function that needs to be invoked whenever the component is updated/dependency array changes.
deps: Array: The dependency array
Start the timer, complete your solution, test your solution against the test cases provided by the platform, and submit it. Ideally, you should finish this question within 30 mins.