Boris Traljić
Results
3
comments of
Boris Traljić
I think this is an elegant solution: https://codesandbox.io/s/m1y7vl0vp ```javascript function App() { const [count, setCount] = useState(0); // ***** Initialize countRef.current with count const countRef = useRef(count); const handleClick =...
Is it ok now :) `useEffect(() => countRef.current = count);`
@escaton Ok, but we are living in an asynchronous world. Aren't we? :)