Why not have setState be asynchronous in React? – Reactjs
So... when I do something like: const [count, setCount] = React.useState(0); // in something else now setCount(5); Now, I don't really know when setCount is going to update... I can't be sure. Obviously, the current solution is React.useEffect(() => {…