In React, the useEffect hook is used to synchronize a component with an
external system. It allows you to handle side effects in function components.
The useEffect hook takes two arguments: a callback function that contains
the logic for the side effect, and a dependencies array that determines when
the effect should be run.
The callback function passed to useEffect will be called after the component
is rendered.
The useEffect function returns a cleanup function which will be called when
the component is unmounting or when the effect is re-run. This cleanup
function can be used to perform any necessary cleanup, such as canceling
a network request or removing an event listener.