We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
State has been updated but inside the callback I am getting the old value of component.
const [count, setCount] = useStateWithCallbackLazy(0); const handleClick = () => { setCount(count + 1, (currentCount) => { console.log('current count value - ' + count); }); };
The same question has been updated in stackoverflow: https://stackoverflow.com/questions/74442587/getting-state-old-value-on-react-custom-hook-callback#74442942
The text was updated successfully, but these errors were encountered:
No branches or pull requests
State has been updated but inside the callback I am getting the old value of component.
The same question has been updated in stackoverflow:
https://stackoverflow.com/questions/74442587/getting-state-old-value-on-react-custom-hook-callback#74442942
The text was updated successfully, but these errors were encountered: