Open abba-danmusa opened 4 months ago
I get the above error every time I try to use react-native-raw-bottom-sheet.
You can use useNativeDriver={false}
, but it would be great to figure out which animations/transitions trigger this in the module.
<RBSheet
ref={refRBSheet}
useNativeDriver={false}
>
...
</RBSheet>
I've been facing this same issue for days. I had to make peace with the fact I wasn't going to use "useNativeDriver".
Well, after seeing the issue you opened, I decided to actually find a fix for it and I did. I've created a pull request and hopefully it will get merged by @nysamnang.
But here's what you can do for now.
Open the package "react-native-raw-bottom-sheet" in your node_modules folder and navigate to "src/index.js" You will see this portion of code
<Animated.View testID="AnimatedView" {...(dragOnContent && panResponder.panHandlers)} // Attach pan handlers to content if dragOnContent is true style={[ styles.container, {transform: pan.getTranslateTransform()}, {height: animatedHeight}, customStyles.container, ]}> {draggable && ( // Show draggable icon if set it to true <View testID="DraggableView" {...(!dragOnContent && panResponder.panHandlers)} // Attach pan handlers to draggable icon if dragOnContent is false style={styles.draggableContainer}> <View testID="DraggableIcon" style={[styles.draggableIcon, customStyles.draggableIcon]} /> </View> )} {children} </Animated.View>
replace it with
<Animated.View testID="AnimatedView" {...(dragOnContent && panResponder.panHandlers)} // Attach pan handlers to content if dragOnContent is true style={[ styles.container, {transform: pan.getTranslateTransform()}, {height: useNativeDriver?height:animatedHeight}, customStyles.container, ]}> {draggable && ( // Show draggable icon if set it to true <View testID="DraggableView" {...(!dragOnContent && panResponder.panHandlers)} // Attach pan handlers to draggable icon if dragOnContent is false style={styles.draggableContainer}> <View testID="DraggableIcon" style={[styles.draggableIcon, customStyles.draggableIcon]} /> </View> )} {children} </Animated.View>
Oh, Thank you, @nelson-david, but I've already moved on to use '@gorhom/bottom-sheet', and it works perfectly.
Nevertheless, thank you so much, indeed, I will try that next time.
Oh, Thank you, @nelson-david, but I've already moved on to use '@gorhom/bottom-sheet', and it works perfectly.
Nevertheless, thank you so much, indeed, I will try that next time.
Well just remember, @gorhom/bottom-sheet is using reanimated and it's will make your app size bigger
Any solution here?
Cause: because you haven't set the height in the
<RBSheet ...>
<View style={{ height: '100%', width: '100%', backgroundColor: '#000', justifyContent: 'center', alignItems: 'center' }}>
<Text style={{ color: '#fff' }}>Hello</Text>
</View>
</RBSheet>
I get the above error every time I try to use react-native-raw-bottom-sheet.