useEffect
is used to perform side effects in functional components. These are operations that can interact with the outside world, such as API requests, timers, DOM manipulations, or subscriptions.
What is a Side Effect?
A side effect in programming occurs when a function or expression modifies some state outside its local environment, or has an observable interaction with the outside world besides returning a value. This could involve:
- Modifying any external variable or object property.