I noticed some performance-related issues on my React native app (Android Version) while using the React native API (Pressable). When pressed, it lags for some seconds before it responds especially when using it to navigate between screens. I don't seem to know why this is happening. It works perfectly on IOS.
I upgraded my React Native version to 0.71.2. I expected this to fix the lag but it did not
I am sure the Pressable causes laggy more than other TouchableComponent, please see the code here:
Compare TouchableOpacity with Pressability
You can see Pressable is a heavy component, it holds more events, even it's own Gesture, hence I suggest to do not using Pressable many times, such as in the FlatList item...
I encountered a similar issue in my project, and I found a solution that worked for me. I was using createStackNavigator from react-navigation, and I was experiencing lag on Android. After replacing it with createNativeStackNavigator, the performance issue was resolved. It might be worth trying out in your project as well. Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With