Since we know that setTimeout() function execute only once then how the following program executing continuously:
import {useState} from "react"
const App = () => {
const [counter, setcounter] = useState(0);
setTimeout( () => setcounter (counter+1), 1000)
return (
<div>{counter} </div>
)
}
export default App
please anybody can identify it? which code piece triggering the setTimeout() to execute continuously?