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

Fix suppression of re-renders with Suspense #952

Closed

Conversation

drarmstr
Copy link
Contributor

@drarmstr drarmstr commented Apr 2, 2021

Summary:
Fix the ability to suppress re-rendering React Components that depends on Recoil Selectors which evaluate to equivalent values via reference equality.

The problem was that when components observed a selector in a pending state it would suspend using Suspense. This would cancel the execution of useEffect()'s and skip recording the previous selector values. Then, if the selector reverted to the same value it had before the suspense, it wouldn't appear the value changed and the component could get stuck in Suspense.

Differential Revision: D27547654

@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 Apr 2, 2021
@facebook-github-bot
Copy link
Contributor

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

Summary:
Pull Request resolved: facebookexperimental#952

Fix the ability to suppress re-rendering React Components that depends on Recoil Selectors which evaluate to equivalent values via reference equality.

The problem was that when components observed a selector in a pending state it would suspend using Suspense.  This would cancel the execution of `useEffect()`'s and skip recording the previous selector values.  Then, if the selector reverted to the same value it had before the suspense, it wouldn't appear the value changed and the component could get stuck in Suspense.

This fix also fixes the extra re-render observed in the `Recoil_PublicHooks-test.js` when the React Tracing API was removed.

Differential Revision: D27547654

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

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

@drarmstr drarmstr self-assigned this Apr 23, 2021
@drarmstr
Copy link
Contributor Author

PR didn't auto-close with commit landing.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in f17888e.

AlexGuz23 pushed a commit to AlexGuz23/Recoil that referenced this pull request Nov 3, 2022
Summary:
Pull Request resolved: facebookexperimental/Recoil#952

Fix the ability to suppress re-rendering React Components that depends on Recoil Selectors which evaluate to equivalent values via reference equality.

The problem was that when components observed a selector in a pending state it would suspend using Suspense.  This would cancel the execution of `useEffect()`'s and skip recording the previous selector values.  Then, if the selector reverted to the same value it had before the suspense, it wouldn't appear the value changed and the component could get stuck in Suspense.

This fix also fixes the extra re-render observed in the `Recoil_PublicHooks-test.js` when the React Tracing API was removed.

Reviewed By: davidmccabe

Differential Revision: D27547654

fbshipit-source-id: 8e155154a7dd6160e9e7e493c7dfddd54f309ca9
snipershooter0701 pushed a commit to snipershooter0701/Recoil that referenced this pull request Mar 5, 2023
Summary:
Pull Request resolved: facebookexperimental/Recoil#952

Fix the ability to suppress re-rendering React Components that depends on Recoil Selectors which evaluate to equivalent values via reference equality.

The problem was that when components observed a selector in a pending state it would suspend using Suspense.  This would cancel the execution of `useEffect()`'s and skip recording the previous selector values.  Then, if the selector reverted to the same value it had before the suspense, it wouldn't appear the value changed and the component could get stuck in Suspense.

This fix also fixes the extra re-render observed in the `Recoil_PublicHooks-test.js` when the React Tracing API was removed.

Reviewed By: davidmccabe

Differential Revision: D27547654

fbshipit-source-id: 8e155154a7dd6160e9e7e493c7dfddd54f309ca9
eagle2722 added a commit to eagle2722/Recoil that referenced this pull request Sep 21, 2024
Summary:
Pull Request resolved: facebookexperimental/Recoil#952

Fix the ability to suppress re-rendering React Components that depends on Recoil Selectors which evaluate to equivalent values via reference equality.

The problem was that when components observed a selector in a pending state it would suspend using Suspense.  This would cancel the execution of `useEffect()`'s and skip recording the previous selector values.  Then, if the selector reverted to the same value it had before the suspense, it wouldn't appear the value changed and the component could get stuck in Suspense.

This fix also fixes the extra re-render observed in the `Recoil_PublicHooks-test.js` when the React Tracing API was removed.

Reviewed By: davidmccabe

Differential Revision: D27547654

fbshipit-source-id: 8e155154a7dd6160e9e7e493c7dfddd54f309ca9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants