flash-list: [Warning] FlashList's rendered size is not usable.
Hi there, so I tried migrating from Flatlist, a but I keep getting a warning:
FlashList's rendered size is not usable. Either the height or width is too small (<2px).
Please make sure that the parent view of the list has a valid size.
FlashList will match the size of the parent.
This is what my code looks like:
const FlashListView = ({ data }: IProps) => {
const keyExtractor = (item: IBookmark) => item._id;
return (
<View style={{ flex: 1 }}>
<FlashList
data={data}
estimatedItemSize={200}
keyExtractor={keyExtractor}
renderItem={({ item }) => (
<View style={{ height: 10, width: "100%" }}>
{item.name}
</View>
)}
/>
</View>
);
};
I understand it’s simply a warning, but I’m curious if I’ve been missing something or doing something wrong, thanks.
The project is on Expo SDK 45 (dev-client) & react-native: 0.68.2.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 23
Applying flexDirection: “row” in the View that contains the flashlist fixed it for me
For someone need:
My problem was that I passed an empty array into data during the first render.
My primitive solution:
My
FlashList
was inside aScrollView
, so I addedflexGrow: 1
to the it and it worked.I tried every solution mentioned in the replies but still getting the warning. any suggestion?
It must be declared in the top view of the file to take effect
You can monitor onLayout on the list and see when it’s raised as 0. Overall, this is expected if the list’s size is incorrect.