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

Pass extraData to stickyOverrideRowRenderer #1310

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Pass extraData to stickyOverrideRowRenderer to re-render sticky h…
…eaders

In our usage of FlashList we have a "selected" checkbox on the sticky header of each group. 

When these rows are stuck to the top, they don't update when `extraData` changes. When they come unstuck from the top, they update immediately. Regular header rows are updated when `extraData` changes, but these for some reason aren't.

We've been testing this locally and it works nicely. I don't know whether there's a specific reason that `extraData` is not included in sticky row renderers, but it seems reasonable that rows should behave the same way when they're stuck as they do when they're not stuck.
  • Loading branch information
elliottkember authored Aug 7, 2024
commit 15b898fb2494b8149a5c1ccd622247f1d0b08cc1
3 changes: 2 additions & 1 deletion src/FlashList.tsx
Original file line number Diff line number Diff line change
@@ -695,14 +695,15 @@ class FlashList<T> extends React.PureComponent<
_: any,
__: any,
index: number,
___: any
extraData: any
) => {
return (
<PureComponentWrapper
ref={this.stickyContentRef}
enabled={this.isStickyEnabled}
arg={index}
renderer={this.rowRendererSticky}
extraData={extraData}
/>
);
};
Loading
Oops, something went wrong.