Skip to content

Conversation

ufokraana
Copy link

Currently, if a component using usePromise (or useFetch, which uses usePromise) is unmounted before the encapsulated work is complete. It will still try to update the react state and trigger an annoying warning in react dev mode.

This wraps the state updates inside a check to see if the component is still mounted.

Currently, if a component using usePromise (or useFetch, which uses usePromise) is unmounted before the encapsulated work is complete. It will still try to update the react state and trigger an annoying warning in react dev mode.

This wraps the state updates inside a check to see if the component is still mounted.
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.

1 participant