react-native-draggable-flatlist icon indicating copy to clipboard operation
react-native-draggable-flatlist copied to clipboard

Can't measure 49 reason: no ref log

Open Malikkhoja-zz opened this issue 4 years ago • 9 comments

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

Malikkhoja-zz avatar Jun 16 '20 14:06 Malikkhoja-zz

Any update?

Malikkhoja-zz avatar Jun 22 '20 10:06 Malikkhoja-zz

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>

bernardnongpoh avatar Jul 16 '20 19:07 bernardnongpoh

What if I cannot use a View arround the FlatList?

FrankFundel avatar Jul 16 '20 19:07 FrankFundel

@bernardnongpoh My Code is exactly same, still the issue exists. The logs says ## can't measure 49 reason: no ref

tradebulls avatar Jul 17 '20 06:07 tradebulls

What if I cannot use a View arround the FlatList?

Worked fine for me without View

bernardnongpoh avatar Jul 17 '20 08:07 bernardnongpoh

@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

bernardnongpoh avatar Jul 17 '20 08:07 bernardnongpoh

<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

tradebulls avatar Jul 24 '20 06:07 tradebulls

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.

callaars avatar Sep 17 '20 10:09 callaars

@computerjazz Should be resolved with the new debug prop if I'm right?

creambyemute avatar Oct 28 '20 19:10 creambyemute