Dynamic sticky headers crash natively (Android only)
See original GitHub issueThe FlatList crash natively when updating the stickyHeaderIndices
prop.
The purpose of my component is to fetch items, and display them inside a flatlist. Some of the loaded items need to be sticky. It’s possible to know which ones only once they are loaded.
The problem is that it crashes when stickyHeaderIndices
is updated at the same render the new data is added to the flatlist.
Demo: https://snack.expo.io/SkfE8USRN
React Native version:
React Native Environment Info:
System:
OS: macOS 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 410.81 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node
Yarn: 1.16.0 - ~/.nvm/versions/node/v10.13.0/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.13.0/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: 23, 25, 26, 27, 28
Build Tools: 23.0.1, 25.0.2, 26.0.2, 26.0.3, 27.0.0, 27.0.3, 28.0.2, 28.0.3
System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: ^16.8.6 => 16.8.6
react-native: ^0.59.8 => 0.59.8
npmGlobalPackages:
react-native-cli: 2.0.1
Steps To Reproduce
- Render a flat list with empty data array.
- Load your datas (or wait some seconds), and update your array state with the items you loaded.
- Compute headers indices for chosen items.
Describe what you expected to happen: No crash.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:18
- Comments:35 (2 by maintainers)
Top Results From Across the Web
Diagnosing Native Crashes | Android Open Source Project
The following sections include common types of native crash, an analysis of a sample crash dump, and a discussion of tombstones.
Read more >SfTabView issues on Android | Xamarin.Forms Forums
Header content scrollable: 2) If i change "IsVisible" from code behind dynamically and I have set up "EnableVirtualization=true", app crashes ...
Read more >Uber Eats Sticky Header - “Can it be done in React Native?”
In this video, we are building the Uber Eats sticky header :Hope you enjoy it Wanna learn the fundamentals of declarative Gestures and ......
Read more >sticky or pinned sectioned list view in android with dynamic data
You can use the API for StickyListHeaders how you want and not use a char. I took this sample and changed a few...
Read more >Microsoft Edge Browser Policy Documentation
Note: this policy ONLY impacts Edge, so navigations from other ... If you disable this policy, the extra header is not added to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found a temporary workaround for this issue. You can set
removeClippedSubviews
tofalse
and it should work as intended.I have the same issue after upgrade to RN 59