5 Common mistakes when using useEffect in React
Briefly

"useEffect allows you to perform side effects, such as data fetching or DOM manipulation, in a functional component. To ensure these side effects run when necessary, you need to provide a dependency array as the second argument to useEffect."
"When using useEffect, it's important to provide a dependency array as the second argument to ensure that side effects run when necessary. For example, if you want an effect to run whenever a specific state variable changes, you should include that variable in the dependency array."
Read at Medium
[
add
]
[
|
|
]