Javascript – Trying to understand this simple useEffect behaviour
I'm a beginner in React.js, and I was reading this article: https://blog.logrocket.com/solve-react-useeffect-hook-infinite-loop-patterns/ There, there's this code: function App() { const [count, setCount] = useState(0); useEffect(() => { setCount((count) => count + 1); }, []); return ( <div className="App"> <p> value…