Skip to content
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

extraData does not seem to work for sticky headers #1152

Open
1 of 2 tasks
antoinerousseau opened this issue Apr 11, 2024 · 1 comment
Open
1 of 2 tasks

extraData does not seem to work for sticky headers #1152

antoinerousseau opened this issue Apr 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@antoinerousseau
Copy link

antoinerousseau commented Apr 11, 2024

Current behavior

I want to change an icon in a sticky header when the list has scrolled past a certain point.
For that, I pass a prop in extraData: { iconColor: "red" / "green" }
When I don't use stickyHeaderIndices, it works (the icon turns from red to green when passing the 150px scrollY threshold):

Simulator.Screen.Recording.-.iPhone.15.-.2024-04-12.at.00.37.07.mp4

But when using stickyHeaderIndices, the header is not re-rendered (unless the target changes):

Simulator.Screen.Recording.-.iPhone.15.-.2024-04-12.at.00.40.16.mp4

But if I console.log in the header render function, I see the right value! It just does not render!

Here is an extract of the relevant code:

<FlashList<ListItem>
  data={items}
  getItemType={getItemType}
  keyExtractor={keyIdExtractor}
  renderItem={handleRenderItem}
  overrideItemLayout={handleOverrideItemLayout}
  stickyHeaderIndices={headerIndices}
  onScroll={handleScroll}
  extraData={extraData}
  estimatedListSize={WindowDimensions}
  // and more unrelated props
/>

Expected behavior

The icon color in the sticky should change when extraData changes.

To Reproduce

Platform:

  • iOS
  • Android (haven't tested yet)

Environment

1.6.4

@antoinerousseau antoinerousseau added the bug Something isn't working label Apr 11, 2024
@w8ight
Copy link

w8ight commented May 8, 2024

experiencing the same issue using
@shopify/flash-list: "1.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants