useeffect hook react syntax code example
Example 1: react use effect
useEffect(() => {
},[]);
Example 2: useeffect with cleanup
useEffect(() => {
//your code goes here
return () => {
//your cleanup code codes here
};
},[]);
Example 3: usestate
const [count, setCount] = useState(0);