Skip to content
New issue

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

RFC: Invalidate stale useCallback functions #230

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

incepter
Copy link

This RFC aim to invalidate the previous functions returned from useCallback as a way to prevent state functions from being invoked.

useCallbacks return functions are usually used as a way to update state from an async context while closing over some other variable. This leads in most of the cases to a stale state of the component and inconsistencies, plus memory leaks referencing lots of closure variables.

View formatted RFC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant