![I'm using useState hook. How can I run a function right after the setState has updated the state? (useEffect won't work, because I don't want the function to run the first time I'm using useState hook. How can I run a function right after the setState has updated the state? (useEffect won't work, because I don't want the function to run the first time](https://styles.redditmedia.com/t5_2zldd/styles/communityIcon_fbblpo38vy941.png)
I'm using useState hook. How can I run a function right after the setState has updated the state? (useEffect won't work, because I don't want the function to run the first time
![When does the callback inside the setter function of the useState hook execute? · Issue #5982 · reactjs/react.dev · GitHub When does the callback inside the setter function of the useState hook execute? · Issue #5982 · reactjs/react.dev · GitHub](https://user-images.githubusercontent.com/76961348/235561149-4f097335-68f3-4ea6-8169-86eee877a523.png)
When does the callback inside the setter function of the useState hook execute? · Issue #5982 · reactjs/react.dev · GitHub
![useCallbackState: the hook that let you run code after a setState operation finished. | by Ricciuti Paolo | Geek Culture | Medium useCallbackState: the hook that let you run code after a setState operation finished. | by Ricciuti Paolo | Geek Culture | Medium](https://miro.medium.com/v2/resize:fit:1400/1*EU5ECPbg5FD8PvQnSg7CWA.png)
useCallbackState: the hook that let you run code after a setState operation finished. | by Ricciuti Paolo | Geek Culture | Medium
GitHub - WrathChaos/react-use-state-with-callback: Make the useState hook with a callback for React and React Native
![React: Why you should always use a callback function to change the state using useState hook | by Saad Butt | Medium React: Why you should always use a callback function to change the state using useState hook | by Saad Butt | Medium](https://miro.medium.com/v2/resize:fit:1400/1*JCNCHQ_w88TATzmLgiiRtQ.png)