Oh man thanks for this!. I've been stumbled upon this problem. when i couldn't figure out why i not getting latest state from useReducer on useEffect cleanup function and ended up setting variable outside function to track my target state. Thanks again! definitely using useRef after this.
Oh man thanks for this!. I've been stumbled upon this problem. when i couldn't figure out why i not getting latest state from useReducer on useEffect cleanup function and ended up setting variable outside function to track my target state. Thanks again! definitely using useRef after this.
here is the example of it
codesandbox.io/s/reactjs-hook-unab...