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

Some pending callbacks that might have leaked by never being called from native code: {"24342":{"module":"ReanimatedModule","method":"getValue"}, ...}

Open eric-om opened this issue 3 years ago • 14 comments

Describe the bug I have a large list that is updated frequently by the user. The list behaves correctly but when I leave the screen and return to the screen, I receive an expo error saying console.error: There was a problem sending log messages to your development environment RangeError: Maximum call stack size exceeded.. I get multiple identical warnings from console. I have copied the beginning of one warning below. Usually I just get the warning message pulled up on the screen but occasionally my expo client will freeze and return to the home screen of the iPhone or iOS simulator.

I am testing my app on iOS simulator and the expo app on my iPhone.

My draggable flat list: <DraggableFlatList showsVerticalScrollIndicator={false} data={ data } renderItem={renderItem} keyExtractor={(item, index) => index.toString()} onDragEnd={({ data, from, to }) => { // save changes to state using useContext hook }} ListHeaderComponent={renderHeader} ListFooterComponent={renderFooter} />

From expo: console.error: There was a problem sending log messages to your development environment RangeError: Maximum call stack size exceeded.

From console: Warning: Please report: Excessive number of pending callbacks: 501. Some pending callbacks that might have leaked by never being called from native code: {"24342":{"module":"ReanimatedModule","method":"getValue"},"24386":{"module":"ReanimatedModule","method":"getValue"},"24426":{"module":"ReanimatedModule","method":"getValue"},"24429":{"module":"ReanimatedModule","method":"getValue"},"24443":{"module":"ReanimatedModule","method":"getValue"},"24473": ...

To Reproduce

Platform & Dependencies Please list any applicable dependencies in addition to those below (react-navigation etc).

  • Platform: iOS (haven't tested on Android)
  • React Native or Expo version: Expo 38.0.0
  • Reanimated version: [email protected]
  • React Native Gesture Handler version: [email protected]

Additional context Add any other context about the problem here.

eric-om avatar Jul 27 '20 23:07 eric-om

It seems that this error comes from onUnmount callback of <RowItem/>. For me it happened when I emptied the draggable list and fixed it by conditionally rendering the <DraggableFlatList/> when list is empty:

{queue.length && <DraggableFlatList />}

Not ideal, but works for now.

antzhdanov avatar Oct 18 '20 15:10 antzhdanov

In my case, it seems the error happens because I display DraggableFlatList before the component is mounted. I fix it this way:

state = {
    didFinishInitialAnimation: false
};

componentDidMount() {
    InteractionManager.runAfterInteractions(() => {
        this.setState({
            didFinishInitialAnimation: true
        });
    });
}

render() {
    const { didFinishInitialAnimation } = this.state;
    return didFinishInitialAnimation && (
        <DraggableFlatList
            ...
        />
    );
}

No more errors in logs and, also, no more lags.

Aximem avatar Oct 30 '20 14:10 Aximem

We have this as well in combination mostly prone to happen together with react-native-swipeable-item.

SvenJonsson avatar Nov 06 '20 03:11 SvenJonsson

I have this as well when I reset the navigation stack by react-navigation.

JungHsuan avatar Jan 29 '21 06:01 JungHsuan

I have this as well when I reset the navigation stack by react-navigation.

I am also facing same issue, any solution found?

rajeshtechnospurs avatar Mar 08 '21 06:03 rajeshtechnospurs

We have this as well in combination mostly prone to happen together with react-native-swipeable-item.

I am also facing same issue, any solution found? :-(

joseasanchezzz91 avatar Mar 16 '21 15:03 joseasanchezzz91

I have this as well when I reset the navigation stack by react-navigation.

Having the same issue and happens only on Android.

zemuldo avatar Jun 27 '21 05:06 zemuldo

Same issue

ArturoTorresMartinez avatar Nov 10 '21 03:11 ArturoTorresMartinez

Still facing the same issue with a big list on newest versions of all libs.

lachtos avatar Jan 19 '22 09:01 lachtos

one possibility is too many nested navigators in react-navigation

vbylen avatar Jan 20 '22 04:01 vbylen

I've encounter this problem too. And I solve it by not using ListEmptyComponent in DraggableFlatList, just change it to conditionally render. Not sure if it is the problem here.

// Before
<DraggableFlatList
  {...other props}
  ListEmptyComponent={<Empty />}
/>

// After
{!!data.length ?
<DraggableFlatList {...other props} /> : <Empty />
}

qaws5503 avatar Jul 05 '22 18:07 qaws5503

I've encounter this problem too. And I solve it by not using ListEmptyComponent in DraggableFlatList, just change it to conditionally render. Not sure if it is the problem here.

// Before
<DraggableFlatList
  {...other props}
  ListEmptyComponent={<Empty />}
/>

// After
{!!data.length ?
<DraggableFlatList {...other props} /> : <Empty />
}

Thanks @qaws5503! This worked for me.

hknakn avatar Aug 11 '22 09:08 hknakn

This warning has gone away for me after upgrading from 3.1.2 to 4.0.0-beta.9.

vojto avatar Aug 21 '22 05:08 vojto

What helped me was setting enableLayoutAniationExperimental in 4.0.0.0-beta.12

ucheNkadiCode avatar Nov 06 '22 20:11 ucheNkadiCode