question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic sticky headers crash natively (Android only)

See original GitHub issue

The 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.

See screenshot

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

  1. Render a flat list with empty data array.
  2. Load your datas (or wait some seconds), and update your array state with the items you loaded.
  3. Compute headers indices for chosen items.

Describe what you expected to happen: No crash.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:18
  • Comments:35 (2 by maintainers)

github_iconTop GitHub Comments

72reactions
yeswanthcommented, Jun 11, 2019

I found a temporary workaround for this issue. You can set removeClippedSubviews to false and it should work as intended.

8reactions
changLiuUNSWcommented, Jun 7, 2019

I have the same issue after upgrade to RN 59

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found