Open ChenLiangZhen opened 1 year ago
Getting porfomance issue while switching between react-navigation-button-tabs.
Might be helpful solution - shouldComponentUpdate()
Temporary solution:
In ticket #150 someone suggested using TouchableOpacity from react-native-gesture-handler but that doesn't work for me (I find it barely usable and I don't want the opacity effect)
My temporary workaround is by using BaseButton component from react-native-gesture-handler, it is somewhat similar to pressable and can be styled like any other react native components
I suspect that the gesture handler system in React Navigation is conflicting with Carousel's. But in my understanding React Navigation itself uses RNGH to handle gestures. So I don't know what actually happened here.
I also solved this issue by using TapGestureHandler component for the pressable component from 'react-native-gesture-handler' instead of using TouchableOpacity
Using TouchableWithoutFeedback
from react-native-gesture-handler
solved a similar issue for me.
@Vahan-Asryan the issue with touchableWithoutFeedback, is that you're unable to wrap a pressable that's inside it
@Vahan-Asryan the issue with touchableWithoutFeedback, is that you're unable to wrap a pressable that's inside it
When a Pressable
from react-native
is used inside carousel, it triggers press event when carousel is swapped. This issue is fixed when TouchableWithoutFeedback
from react-native-gesture-handler
is used instead.
This issue is quite similar to ticket #150
I've double checked and firmly believe there're some problem with the package.
System: MacOS, Macbook M2
This is my package.json
I have a carousel component with two renderItem, each item is a Pressable component. the problem is, when I swipe the carousel, it automatically registered as tap and triggered onPress function inside Pressable.
Something strange
the issue only happens on iOS
When using in newly created project (without React Navigation), everything works fine. Swipe gesture works absolutely normal. But if using in newly created project with React Navigation ( the Carousel component is inside a React Navigation screen ), when swiping the carousel doesn't work normally instead it treat my swipe gesture as a tap gesture and triggered onPress function in my Pressable item.
I've wrapped the base view component with GestureHandlerRootView component.
Anyone has idea?