react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

FlatList `measureLayoutRelativeToContainingList` error

Open ShaMan123 opened this issue 7 years ago • 17 comments

I'm working on RN0.60+. Seems that something changed in react-native/Libraries/Lists/VirtualizedList.js and therefore this error shows up. This happens when:

import { FlatList as RNFlatList } from 'react-native';
import { FlatList } from 'react-native-gesture-handler';


<RNFlatList 
   renderScrollComponent={(props) => <ScrollView {...props} />} 
/>

//  OR

<FlatList />

I'm getting

undefined is not a function (near '...this._scrollRef.measureLayout...')

RNGH version: 1.3.0, I'm using a clone even with this repo.

ShaMan123 avatar Jul 26 '19 07:07 ShaMan123

Is this related to passing ref={React.createRef()}?

ShaMan123 avatar Jul 27 '19 11:07 ShaMan123

Same here after using FlatList from this lib Any fix?

kesha-antonov avatar Oct 08 '19 16:10 kesha-antonov

Any update on this? happening after RN0.60+ update.

sivakumar-cf avatar Oct 23 '19 08:10 sivakumar-cf

Same issue after RN0.61.5 using react-native and react-native-gesture-handler

StefanWegener avatar Dec 03 '19 15:12 StefanWegener

Seeing this too under the same conditions. I'm getting a warning only, and the functionality is still there. Are you guys getting crashing errors?

fozzarelo avatar Jan 22 '20 19:01 fozzarelo

I got the same error as well.

thormengkheang avatar Feb 06 '20 08:02 thormengkheang

When using two nested FlatLists (imported from 'react-native-gesture-handler'), I got the same error. But after changing the inner FlatList to ScrollView, the error disappeared.

oguzhanun avatar Feb 08 '20 11:02 oguzhanun

import FlatList from 'react-native'

Babar-Memon avatar Feb 19 '20 06:02 Babar-Memon

When using two nested FlatLists (imported from 'react-native-gesture-handler'), I got the same error. But after changing the inner FlatList to ScrollView, the error disappeared.

Yes, I have same issues when using two nested FlatList

namphd00769 avatar Apr 09 '20 08:04 namphd00769

Same Here

cklinx avatar Apr 25 '20 15:04 cklinx

Same error using two nested horizontal FlatLists (from 'react-native-gesture-handler').

matapo avatar May 05 '20 08:05 matapo

Any progress on this?

nnabinh avatar May 14 '20 00:05 nnabinh

Any updates on this issue?

bwoodlt avatar Jun 02 '20 14:06 bwoodlt

Using the regular FlatList from react native makes this error go away, however I need the FlatList to respond to nested gestures from a larger list, so this won't work for my use. Any updates on this would be appreciated.

wzahedi avatar Jun 05 '20 21:06 wzahedi

I have this issue as well for a FlatList with filters. If I spam the filters rapidly so it's constantly changing the list content, I suppose somehow it cannot respond quickly with the layout measurement? Setting the getItemLayout prop does help though. Just curious if there's another way.

fabianlee1211 avatar Jun 10 '20 09:06 fabianlee1211

Hi folks - any news updates on this?

pedrocunha avatar Nov 14 '20 13:11 pedrocunha

I tested it on 1.10.2 and everything seems to work, so I recommend updating the gesture-handler version in your project. let me know if something is still broken.

piaskowyk avatar Mar 31 '22 09:03 piaskowyk