keyExtractor item is sometimes undefined after item delete #560
Unanswered
mgscreativa
asked this question in
Q&A
Replies: 1 comment
-
Will it be possible for you to create an expo snack for this so that I can take a look? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! using "@shopify/flash-list": "1.1.0" in an RN Expo (SDK 46) project. I have some issues with the keyExtractor (need it for prepareForLayoutAnimationRender() as stated here https://shopify.github.io/flash-list/docs/guides/layout-animation). I'm using "zustand": "^4.0.0" for state management, the items array comes from that store.
If I remove an item from the list (calling a zustand remove action), the keyExtractor sometimes get an undefined item to process.
First of all, this is my keyExtractor
This is my remove item hook
This is my item type definition
EDIT: It also happens in the renderItem prop. Have to add item && ( to the renderItem function return because after item deletion, some items to render are undefined!
This is the initial render with three items
And this are some errors I've got after one item deletion using my keyExtractor return item.msgId;
Beta Was this translation helpful? Give feedback.
All reactions