UseEffect
useEffect hook is used to perform side effects in function components. Side effects might include data fetching, subscriptions, or manually changing the DOM.
use effect dependencies
-
a specific value is givenIn case of a specific value is given, useEffect function will only run when that values changes.
-
empty arrayIn case of empty array, useEffect function will only run once.
-
no valueuseEffect function will run every single time.