react useEffect | react useEffect hooks | react useEffect hook in hindi

Опубликовано: 19 Октябрь 2025
на канале: Code With Fun
91
11

React useEffect Hooks

The useEffect Hook allows you to perform side effects in your components.
Some examples of side effects are: fetching data, directly updating the DOM, and timers.
useEffect accepts two arguments. The second argument is optional.
useEffect(function, dependency)

useEffect runs on every render. That means that when the count changes, a render happens, which then triggers another effect.
This is not what we want. There are several ways to control when side effects run.
We should always include the second parameter which accepts an array. We can optionally pass dependencies to useEffect in this array.