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

Prevent notifyBatcherOfChange from updating state after a Batcher is unmounted #917

Closed

Conversation

derekxu16
Copy link
Contributor

Summary:
This sets notifyBatcherOfChange to an empty function when Batcher unmounts.

Previously, if you unmounted RecoilRoot when an asynchronous selector was still pending, notifyBatcherOfChange on line 383 would be called after Batcher was already unmounted, causing the following error to be thrown: "Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application."

Fixes #897

Differential Revision: D26895327

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Mar 9, 2021
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D26895327

derekxu16 added a commit to derekxu16/Recoil that referenced this pull request Mar 9, 2021
…unmounted (facebookexperimental#917)

Summary:
Pull Request resolved: facebookexperimental#917

This sets `notifyBatcherOfChange` to an empty function when Batcher unmounts.

Previously, if you unmounted RecoilRoot when an asynchronous selector was still pending, `notifyBatcherOfChange` on line 383 would be called after Batcher was already unmounted, causing the following error to be thrown: "Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application."

Fixes facebookexperimental#897

Reviewed By: drarmstr, davidmccabe

Differential Revision: D26895327

fbshipit-source-id: 938612144b6234481772d272b86878b856c7369f
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D26895327

@drarmstr drarmstr added the bug Something isn't working label Mar 9, 2021
…unmounted (facebookexperimental#917)

Summary:
Pull Request resolved: facebookexperimental#917

This sets `notifyBatcherOfChange` to an empty function when Batcher unmounts.

Previously, if you unmounted RecoilRoot when an asynchronous selector was still pending, `notifyBatcherOfChange` on line 383 would be called after Batcher was already unmounted, causing the following error to be thrown: "Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application."

Fixes facebookexperimental#897

Reviewed By: drarmstr, davidmccabe

Differential Revision: D26895327

fbshipit-source-id: b44e7fdba968f97ae085dab53dc502cc67be5673
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D26895327

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in dc87f29.

AlexGuz23 pushed a commit to AlexGuz23/Recoil that referenced this pull request Nov 3, 2022
…unmounted (#917)

Summary:
Pull Request resolved: facebookexperimental/Recoil#917

This sets `notifyBatcherOfChange` to an empty function when Batcher unmounts.

Previously, if you unmounted RecoilRoot when an asynchronous selector was still pending, `notifyBatcherOfChange` on line 383 would be called after Batcher was already unmounted, causing the following error to be thrown: "Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application."

Fixes #897

Reviewed By: drarmstr, davidmccabe

Differential Revision: D26895327

fbshipit-source-id: 402e1743bc5e61c4b63c44c6de9fe7fb3f4d180b
snipershooter0701 pushed a commit to snipershooter0701/Recoil that referenced this pull request Mar 5, 2023
…unmounted (#917)

Summary:
Pull Request resolved: facebookexperimental/Recoil#917

This sets `notifyBatcherOfChange` to an empty function when Batcher unmounts.

Previously, if you unmounted RecoilRoot when an asynchronous selector was still pending, `notifyBatcherOfChange` on line 383 would be called after Batcher was already unmounted, causing the following error to be thrown: "Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application."

Fixes #897

Reviewed By: drarmstr, davidmccabe

Differential Revision: D26895327

fbshipit-source-id: 402e1743bc5e61c4b63c44c6de9fe7fb3f4d180b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Asynchronous selector triggers re-render on unmounted RecoilRoot
3 participants