filmov
tv
ReactJs Tutorial - 08 - Tamil | useEffect explained in Tamil - 2023 #reactjstutorial #tamil

Показать описание
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.
So, to fix this issue, let's only run this effect on the initial render.
If there are multiple dependencies, they should be included in the use effect dependency array.
Effect Cleanup
Some effects require cleanup to reduce memory leaks.
Timeouts, subscriptions, event listeners, and other effects that are no longer needed should be disposed of.
We do this by including a return function at the end of the use effect Hook.
React useEffect Explanation - Video Timings:
00:00 - Frontend Koder Intro
00:10 - What are side effects in Javascript?
01:22 - Side Effect Example - Javascript
01:57 - useEffect Example
02:25 - React - useEffect Coding Part - Start
08:40 - React - useEffect Coding Part - End
08:43 - Frontend Koder Outro
React useEffect explained in Tamil, we hope you like this video.
If you found this video about useEffect useful, please like, share and subscribe to @frontendkoder_ Channel.
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.
So, to fix this issue, let's only run this effect on the initial render.
If there are multiple dependencies, they should be included in the use effect dependency array.
Effect Cleanup
Some effects require cleanup to reduce memory leaks.
Timeouts, subscriptions, event listeners, and other effects that are no longer needed should be disposed of.
We do this by including a return function at the end of the use effect Hook.
React useEffect Explanation - Video Timings:
00:00 - Frontend Koder Intro
00:10 - What are side effects in Javascript?
01:22 - Side Effect Example - Javascript
01:57 - useEffect Example
02:25 - React - useEffect Coding Part - Start
08:40 - React - useEffect Coding Part - End
08:43 - Frontend Koder Outro
React useEffect explained in Tamil, we hope you like this video.
If you found this video about useEffect useful, please like, share and subscribe to @frontendkoder_ Channel.
Комментарии