React.useEffect() also serves as a watcher for variable changes. If you include a variable in the dependency array, the body of the hook will run every time the variable changes.
0
  • Counter value has been updated to: 0