-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PLEASE REPORT: Excessive number of pending callbacks: 501 #34442
Comments
That is a busy component 🙃 i don't have a solution for you but I run into similar issues. Did you find any solution? |
@Svarto this component was being rendered inside another flatlist in another component. I just took it out of the flatlist and it worked fine. Just be careful of a lot of animated code being fired at once. |
I just ran into this same issue. I tracked it down to the TouchableOpacities in a few components and replaced them with Pressables, and that got rid of the error. I think the "NativeAnimatedModule" is referring to the animation on the touchableOpacity components |
Yeah this seems to be caused by a change to TouchableOpacity in React Native 0.69.... (flattenStyle(prevProps.style)?.opacity !==
flattenStyle(this.props.style)?.opacity) !==
undefined is always going to evaluate to true, therefore calling Quick fix: remove the |
I had been battling with this issue for days, tried all sorts of things... @treykapfer thank you for finally pointing us in the right direction 👍 |
It saved my life. Thanks! |
Had exactly this issue, Girum's solution worked for me. |
Thanks @Girum It works for me |
I got the same issue in 70.5 even though It has @Girum's fix on it. I had to change TouchcableOpacity to Pressable to solve it. |
Also encountered this using Update: Using |
THANK YOU, this is the only solution that worked for me :) |
…f pending callbacks (#35387) Summary: The commit 3eddc9a included on v0.69 introduced a wrong `if` statement inside the `componentDidUpdate` function of the `TouchableOpacity` component. As this `if` statement always evaluates to `true` (`(true || false) !== undefined`) we end up making unnecessary calls to the `_opacityInactive` method every time the component props changes, e.g. every time a `<Text>` inside the TouchableOpacity changes we call this function over and over, and this has been causing some performance issues on big lists. This PR fixes this problem by adjusting the `componentDidUpdate` function to only call `_opacityInactive` when necessary. Closes #34442 Closes #32476 ## Changelog [General] [Fixed] - Fix TouchableOpacity componentDidUpdate causing an excessive number of pending callbacks Pull Request resolved: #35387 Test Plan: 1. Open the RNTester app and navigate to the `Touchable* and onPress` page 2. Test the `TouchableOpacity` component through the many sections Reviewed By: cipolleschi Differential Revision: D41397396 Pulled By: ryancat fbshipit-source-id: 24863b5cbbdd2f3dd1f654b43d7031560937b888
It is work for me |
I change TouchOpacity to Pressable and it work! ... then style it again with opacity... |
I change touchOpacity to Pressable, but it is not work for me. |
…f pending callbacks (facebook#35387) Summary: The commit facebook@3eddc9a included on v0.69 introduced a wrong `if` statement inside the `componentDidUpdate` function of the `TouchableOpacity` component. As this `if` statement always evaluates to `true` (`(true || false) !== undefined`) we end up making unnecessary calls to the `_opacityInactive` method every time the component props changes, e.g. every time a `<Text>` inside the TouchableOpacity changes we call this function over and over, and this has been causing some performance issues on big lists. This PR fixes this problem by adjusting the `componentDidUpdate` function to only call `_opacityInactive` when necessary. Closes facebook#34442 Closes facebook#32476 ## Changelog [General] [Fixed] - Fix TouchableOpacity componentDidUpdate causing an excessive number of pending callbacks Pull Request resolved: facebook#35387 Test Plan: 1. Open the RNTester app and navigate to the `Touchable* and onPress` page 2. Test the `TouchableOpacity` component through the many sections Reviewed By: cipolleschi Differential Revision: D41397396 Pulled By: ryancat fbshipit-source-id: 24863b5cbbdd2f3dd1f654b43d7031560937b888
Changing all my For anyone interested you can create a custom
|
我也遇到了上述问题,前几天运行很好,突然连接手机启动后也出现了上述问题,以下操作解决了我的问题,希望对大家有帮助
我的开发环境:RN0.67 + Node17 + Android Gradle 7.0.0 + java 11 |
In my case, I just solved the problem by wrapping the onPress function of my TouchableOpacity button if it's a useCallback hook 🚀. |
Thanks, solved the error for me too |
Thanks, |
Thanks @Girum Works for me also |
Description
Hi,
I keep the getting the error seen on the screenshot below. For context, I'm creating an app (IOS) where users can swipe through a number of songs to listen to the audio and comment on each song.
This error warning shows when I finish swiping on a song and load the next one. Any help would be great - my app keeps crashing on my physical device (fine on simulator) after a few swipes. Full error shown below.
Version
0.66.1
Output of
npx react-native info
System:
OS: macOS 12.3.1
CPU: (8) arm64 Apple M1
Memory: 95.30 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.16.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.11.0 - /usr/local/bin/npm
Watchman: 2022.06.27.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 13.4/13F17a - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.1 => 0.69.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Swipe through songs to reproduce.
Snack, code example, screenshot, or link to a repository
The text was updated successfully, but these errors were encountered: