-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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 invariant violation when nesting VirtualizedList inside ListEmptyComponent #35875
Closed
Conversation
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
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.
p: Facebook
Partner: Facebook
Partner
fb-exported
labels
Jan 18, 2023
This pull request was exported from Phabricator. Differential Revision: D42574462 |
This pull request was exported from Phabricator. Differential Revision: D42574462 |
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Jan 18, 2023
…Component (facebook#35875) Summary: Pull Request resolved: facebook#35875 Fixes facebook#35871 Nested VirtualizedLists register to their parents for updates, associated to a specfific cellKey set by VirtualizedListCellContextProvider. This cellKey is usually set when rendering a cell for a data item, but we can also render a nested VirtualizedList by putting one in a ListHeaderComponent/ListFooterComponent/ListEmptyComponent. D6603342 (facebook@a010a0c) added cellKeys when we render from a header/footer, but not ListEmptyComponent, so that association would silently fail earlier. D39466677 (facebook@010da67) added extra invariants to child list handling, that are now triggered by this case, complaining because we are trying to unregister a child list we never successfully registered, due to a missing cellKey. This fixes the issue by providing a cellKey for ListEmptyComponent as well. It also cleans up some of the parameterization needed from when we had two VirtualizedList implementations. Changelog: [General][Fixed] - Fix invariant violation when nesting VirtualizedList inside ListEmptyComponent Differential Revision: D42574462 fbshipit-source-id: dfec4981aaaa92b2525779b0f6c643688752fd04
NickGerleman
force-pushed
the
export-D42574462
branch
from
January 18, 2023 14:05
1f5f284
to
5efb813
Compare
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Jan 18, 2023
…Component (facebook#35875) Summary: Pull Request resolved: facebook#35875 Fixes facebook#35871 Nested VirtualizedLists register to their parents for updates, associated to a specfific cellKey set by VirtualizedListCellContextProvider. This cellKey is usually set when rendering a cell for a data item, but we can also render a nested VirtualizedList by putting one in a ListHeaderComponent/ListFooterComponent/ListEmptyComponent. D6603342 (facebook@a010a0c) added cellKeys when we render from a header/footer, but not ListEmptyComponent, so that association would silently fail earlier. D39466677 (facebook@010da67) added extra invariants to child list handling, that are now triggered by this case, complaining because we are trying to unregister a child list we never successfully registered, due to a missing cellKey. This fixes the issue by providing a cellKey for ListEmptyComponent as well. It also cleans up some of the parameterization needed from when we had two VirtualizedList implementations. Changelog: [General][Fixed] - Fix invariant violation when nesting VirtualizedList inside ListEmptyComponent Differential Revision: D42574462 fbshipit-source-id: 496db5145616c2149584f74957fc6027c2ac0d3a
NickGerleman
force-pushed
the
export-D42574462
branch
from
January 18, 2023 14:12
5efb813
to
615dcfd
Compare
This pull request was exported from Phabricator. Differential Revision: D42574462 |
…Component (facebook#35875) Summary: Pull Request resolved: facebook#35875 Fixes facebook#35871 Nested VirtualizedLists register to their parents for updates, associated to a specfific cellKey set by VirtualizedListCellContextProvider. This cellKey is usually set when rendering a cell for a data item, but we can also render a nested VirtualizedList by putting one in a ListHeaderComponent/ListFooterComponent/ListEmptyComponent. D6603342 (facebook@a010a0c) added cellKeys when we render from a header/footer, but not ListEmptyComponent, so that association would silently fail earlier. D39466677 (facebook@010da67) added extra invariants to child list handling, that are now triggered by this case, complaining because we are trying to unregister a child list we never successfully registered, due to a missing cellKey. This fixes the issue by providing a cellKey for ListEmptyComponent as well. Changelog: [General][Fixed] - Fix invariant violation when nesting VirtualizedList inside ListEmptyComponent Differential Revision: D42574462 fbshipit-source-id: 99b51f891737eeb8b3b58b94aa6d4fd04a35d12d
NickGerleman
force-pushed
the
export-D42574462
branch
from
January 18, 2023 14:25
615dcfd
to
be8524b
Compare
This pull request was exported from Phabricator. Differential Revision: D42574462 |
Base commit: 473eb1d |
This pull request has been merged in 1fef376. |
kelset
pushed a commit
that referenced
this pull request
Jan 30, 2023
…Component (#35875) Summary: Pull Request resolved: #35875 Fixes #35871 Nested VirtualizedLists register to their parents for updates, associated to a specfific cellKey set by VirtualizedListCellContextProvider. This cellKey is usually set when rendering a cell for a data item, but we can also render a nested VirtualizedList by putting one in a ListHeaderComponent/ListFooterComponent/ListEmptyComponent. D6603342 (a010a0c) added cellKeys when we render from a header/footer, but not ListEmptyComponent, so that association would silently fail earlier. D39466677 (010da67) added extra invariants to child list handling, that are now triggered by this case, complaining because we are trying to unregister a child list we never successfully registered, due to a missing cellKey. This fixes the issue by providing a cellKey for ListEmptyComponent as well. Changelog: [General][Fixed] - Fix invariant violation when nesting VirtualizedList inside ListEmptyComponent Reviewed By: christophpurrer Differential Revision: D42574462 fbshipit-source-id: f76fa795bf471cb8a929c2efdbd814ea51927663 # Conflicts: # Libraries/Lists/VirtualizedList.js
OlimpiaZurek
pushed a commit
to OlimpiaZurek/react-native
that referenced
this pull request
May 22, 2023
…Component (facebook#35875) Summary: Pull Request resolved: facebook#35875 Fixes facebook#35871 Nested VirtualizedLists register to their parents for updates, associated to a specfific cellKey set by VirtualizedListCellContextProvider. This cellKey is usually set when rendering a cell for a data item, but we can also render a nested VirtualizedList by putting one in a ListHeaderComponent/ListFooterComponent/ListEmptyComponent. D6603342 (facebook@a010a0c) added cellKeys when we render from a header/footer, but not ListEmptyComponent, so that association would silently fail earlier. D39466677 (facebook@010da67) added extra invariants to child list handling, that are now triggered by this case, complaining because we are trying to unregister a child list we never successfully registered, due to a missing cellKey. This fixes the issue by providing a cellKey for ListEmptyComponent as well. Changelog: [General][Fixed] - Fix invariant violation when nesting VirtualizedList inside ListEmptyComponent Reviewed By: christophpurrer Differential Revision: D42574462 fbshipit-source-id: f76fa795bf471cb8a929c2efdbd814ea51927663
Merged
This was referenced Jan 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
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
This PR has been merged.
p: Facebook
Partner: Facebook
Partner
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Fixes #35871
Nested VirtualizedLists register to their parents for updates, associated to a specfific cellKey set by VirtualizedListCellContextProvider. This cellKey is usually set when rendering a cell for a data item, but we can also render a nested VirtualizedList by putting one in a ListHeaderComponent/ListFooterComponent/ListEmptyComponent.
D6603342 (a010a0c) added cellKeys when we render from a header/footer, but not ListEmptyComponent, so that association would silently fail earlier.
D39466677 (010da67) added extra invariants to child list handling, that are now triggered by this case, complaining because we are trying to unregister a child list we never successfully registered, due to a missing cellKey.
This fixes the issue by providing a cellKey for ListEmptyComponent as well. It also cleans up some of the parameterization needed from when we had two VirtualizedList implementations.
Changelog:
[General][Fixed] - Fix invariant violation when nesting VirtualizedList inside ListEmptyComponent
Differential Revision: D42574462