-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix selector issue with early rendering mode (#1566)
Summary: Pull Request resolved: facebookexperimental/Recoil#1566 Normally when a dependency resolves it notifies downstream components to re-render and this is sufficient. While it is still pending, the selector returns this promise; subsequent renders while pending will re-use the same loadable using `getExecutionInfoOfInProgressExecution()`. However, there is a corner case we have to notify components that an async selector has resolved, even if the selector does not have a "current pending execution": 1) A component renders with this pending loadable. 2) The upstream dependency resolves. 3) While processing some other selector it reads this one, such as while traversing its dependencies. At this point it gets the new resolved value synchronously and clears the current execution ID. The component wasn't getting the value itself, though, so it still has the pending loadable. 4) When wrapper handling the resolution executes the current execution id was cleared, so it will never notify the component of the new value. I think this is only an issue with "early" rendering since the components read their value using the in-progress execution. Though, I'm not sure this is necessary with `recoil_concurrent_support` mode. Reviewed By: davidmccabe Differential Revision: D33737833 fbshipit-source-id: ac71f5ac4ea72543f384421054838f0f4c88a9c3
- Loading branch information
1 parent
ded7d28
commit bd183c9
Showing
1 changed file
with
65 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters