Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReactNative 0.43-rc.2 FlatList -- Tried to get frame for out of range index 0

Tags:

react-native

I have a question specific to 0.43-rc.2 I migrated a ListView to a FlatList, and I now get the following error:

TaskQueue: Error with task: Tried to get frame for out of range index 0

which originates form the VirtualizedList class.

If I ignore the error, the list seems to work fine, so I'm really at a loss as to what is wrong.

I can't seem to find any information on why this would happen. Any suggestions?

like image 499
Mobius Avatar asked Mar 17 '17 03:03

Mobius


2 Answers

It looks like this only happens when the array passed to FlatList is empty. I was able to get around this by replacing the list with a View in the case that the data was empty.

like image 197
Mobius Avatar answered Sep 21 '22 16:09

Mobius


This happened to me when I had debug={true}. Removing that fixed it for me.

like image 30
raphaelrk Avatar answered Sep 20 '22 16:09

raphaelrk