react-native-draggable-flatlist
react-native-draggable-flatlist copied to clipboard
Can't measure 49 reason: no ref log
Hi,
The library works perfectly, however we are getting this log every time and on scroll as well. Not sure how to resolve this. Is there any thing that we are doing it wrong?
React Native Version - 0.62.2 Lib - 2.3.3
Any help? Thanks in advance
Any update?
The following code will triggered the warning you mentioned
<View>
<DraggableFlatList
data={contents}
renderItem={renderItem}
keyExtractor={(item) => `draggable-item-${item.id}`}
onDragEnd={async ({ data }) => {
console.log(data);
}}
/>
</View>
By setting style={{flex:1}}
to the <View>
solved the problem
Working code without warning or error
<View style={{ flex: 1 }}>
<DraggableFlatList
data={contents}
renderItem={renderItem}
keyExtractor={(item) => `draggable-item-${item.id}`}
onDragEnd={async ({ data }) => {
console.log(data);
}}
/>
</View>
What if I cannot use a View arround the FlatList?
@bernardnongpoh My Code is exactly same, still the issue exists. The logs says ## can't measure 49 reason: no ref
What if I cannot use a View arround the FlatList?
Worked fine for me without View
@bernardnongpoh My Code is exactly same, still the issue exists. The logs says ## can't measure 49 reason: no ref
Can you please share me your code and react native version
<View style={{ flex: 1 }}>
<DraggableFlatList
data={data}
renderItem={this.renderItem}
keyExtractor={(item) => draggable-item-${item.id}
}
onDragEnd={async ({ data }) => {
console.log(data);
}}
/>
React Native Version 0.63.2
I know why this is, I found out it only happens with items that aren't currently rendered (e.g. offscreen). I suggest removing the no ref
error as the follow-up queue measures it correctly when the VirtualizedList renders the next batch of items (or when it comes into view).
i.e. this is a non-error.
@computerjazz Should be resolved with the new debug
prop if I'm right?