useEffect Hook
* Run first time and every renders
import { useState, useEffect } from 'react';
const Home = () => {
const [counter, setCounter] = useState(0)
useEffect(() => {
console.log("Run on every render")
})
const handleClick = () => {
setCounter(counter + 1)
}
return (
<>
This Is A Counter
{counter}
>
)
}
export default Home;
* Run first time only