Created
December 23, 2020 22:07
-
-
Save jehartzog/ef5e4091d18176c55a84b67c9e5358b7 to your computer and use it in GitHub Desktop.
RN Patch to fix SectionList header remount when switching to/from empty section array
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
diff --git a/node_modules/react-native/Libraries/Lists/VirtualizedSectionList.js b/node_modules/react-native/Libraries/Lists/VirtualizedSectionList.js | |
index 53eb54b..d870b3b 100644 | |
--- a/node_modules/react-native/Libraries/Lists/VirtualizedSectionList.js | |
+++ b/node_modules/react-native/Libraries/Lists/VirtualizedSectionList.js | |
@@ -173,7 +173,7 @@ class VirtualizedSectionList< | |
_computeState(props: Props<SectionT>): State { | |
const offset = props.ListHeaderComponent ? 1 : 0; | |
- const stickyHeaderIndices = []; | |
+ const stickyHeaderIndices = [0]; | |
const itemCount = props.sections | |
? props.sections.reduce((v, section) => { | |
stickyHeaderIndices.push(v + offset); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment