useEffect Hook
What are useEffect Hooks in React?
The Effect Hook lets you perform side effects in function components: Data fetching, setting up a subscription, and manually changing the DOM in React components are all examples of side effects. Whether or not you're used to calling these operations “side effects” (or just “effects”), you've likely performed them in your components before.
app/page.tsx
1import { useState } from "react";
2const App = () => {
3 const [count, setCount] = useState(0);
4
5 useEffect(() => {
6 setTimeout(() => {
7 setCount((count) => count + 1);
8 }, 1000);
9 });
10
11 return <div>Hello , count value is {count}</div>;
12};
13export default App;