Files
react-native/Libraries
Nick Gerleman 1fef376812 Fix invariant violation when nesting VirtualizedList inside ListEmptyComponent (#35875)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35875

Fixes https://github.com/facebook/react-native/issues/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 (https://github.com/facebook/react-native/commit/a010a0cebd4afc0d88336c2c265a5d9dbb19918f) added cellKeys when we render from a header/footer, but not ListEmptyComponent, so that association would silently fail earlier.

D39466677 (https://github.com/facebook/react-native/commit/010da67bef0c22418d0d41b7c2eae664672a4a27) 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
2023-01-19 05:13:50 -08:00
..
2022-09-30 14:28:48 -07:00
2023-01-03 18:09:06 -08:00
2022-09-30 14:28:48 -07:00
2022-12-06 19:34:14 -08:00
2022-09-30 14:28:48 -07:00
2022-09-30 14:28:48 -07:00
2023-01-18 08:21:49 -08:00
2023-01-03 18:09:06 -08:00
2022-09-30 14:28:48 -07:00
2023-01-03 18:09:06 -08:00
2023-01-03 18:09:06 -08:00
2022-09-30 14:28:48 -07:00
2023-01-03 18:09:06 -08:00
2022-12-06 19:34:14 -08:00
2022-12-06 19:34:14 -08:00
2023-01-03 18:09:06 -08:00
2022-11-02 14:58:37 -07:00
2023-01-03 18:09:06 -08:00
2023-01-03 13:19:49 -08:00