Skip to content
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

Error: Style property 'height' is not supported by native animated module #185

Open
abba-danmusa opened this issue Apr 29, 2024 · 6 comments

Comments

@abba-danmusa
Copy link

I get the above error every time I try to use react-native-raw-bottom-sheet.

@LeslieOA
Copy link

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>

@nelson-david
Copy link

nelson-david commented May 2, 2024

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>

@abba-danmusa
Copy link
Author

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.

@zulfio
Copy link

zulfio commented May 21, 2024

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

@Raduc4
Copy link

Raduc4 commented May 29, 2024

Any solution here?

@hoanglq
Copy link

hoanglq commented Jun 15, 2024

Cause: because you haven't set the height in the <RBSheet...> tag.
my example:

<RBSheet ...>
      <View style={{ height: '100%', width: '100%', backgroundColor: '#000', justifyContent: 'center', alignItems: 'center' }}>
                    <Text style={{ color: '#fff' }}>Hello</Text>
       </View>
</RBSheet>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants