Problem Statement
What is the syntax of useEffect(callback, [dependencies])?
Explanation
The useEffect hook accepts a function and an optional dependency array. The effect runs when one of the dependencies changes. An empty array runs it only once after mount.
Code Solution
SolutionRead Only
useEffect(() => {
console.log('Runs on count change');
}, [count]);