-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
FlatList ItemSeparatorComponent doesn't re-render when item change #24592
Labels
Comments
brunolemos
changed the title
FlatList ItemSeparatorComponent doesn't re-render when item changes
FlatList ItemSeparatorComponent doesn't re-render when item change
Apr 25, 2019
brunolemos
added a commit
to brunolemos/react-native
that referenced
this issue
Jun 1, 2019
brunolemos
added a commit
to brunolemos/react-native
that referenced
this issue
Jun 1, 2019
brunolemos
added a commit
to devhubapp/devhub
that referenced
this issue
Jun 1, 2019
M-i-k-e-l
pushed a commit
to M-i-k-e-l/react-native
that referenced
this issue
Mar 10, 2020
…book#25114) Summary: Fix facebook#24592 Just added a `getDerivedStateFromProps`, similar to what `VirtualizedSectionList` already does: https://github.com/facebook/react-native/blob/18fededae085b53b01e54a7ed27e32c2318e7cae/Libraries/Lists/VirtualizedSectionList.js#L470-L492 ## Changelog [General] [Fixed] - Fix ItemSeparatorComponent's leadingItem prop not being updated Pull Request resolved: facebook#25114 Differential Revision: D15602460 Pulled By: cpojer fbshipit-source-id: b16a82912fd746a956f6aa360d18ade53357f634
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
🐛 Bug Report
FlatList
'sItemSeparatorComponent
receives aleadingItem
prop, but when this item change theItemSeparatorComponent
doesn't get updated with the newleadingItem
value.To Reproduce
ItemSeparatorComponent
ItemSeparatorComponent
render different colors based on the receivedleadingItem
ItemSeparatorComponent
doesn't updateExpected Behavior
ItemSeparatorComponent
should re-render when theleadingItem
change as the default behavior.Code Example
https://snack.expo.io/@brunolemos/itemseparatorcomponent-bug
See code
GIF: Item separator is black when item is marked as read, and blue when not. When marking all items as read, all separators should turn black, but they are not being re-rendered.
Environment
See Environment
React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
Memory: 61.35 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.5.0 - /usr/local/bin/node
Yarn: 1.13.0 - ~/.yarn/bin/yarn
npm: 6.7.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 19, 22, 23, 24, 25, 27, 28
Build Tools: 23.0.1, 23.0.3, 24.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.2, 27.0.3, 28.0.0, 28.0.2, 28.0.3
System Images: android-19 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5314842
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmGlobalPackages:
react-native-git-upgrade: 0.2.7
The text was updated successfully, but these errors were encountered: