Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix invariant violation when nesting VirtualizedList inside ListEmpty…
…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
- Loading branch information
@NickGerleman This is now throwing an error
"this.props" should not be accessed during state updates
when using state, setState & props inside the onLayout callback which used to work on previous versions? Is this expected?Reference