Elevation prop style is not rendered on View component
See original GitHub issuebug report
Version & Platform
npm ls react-native react-native-view-shot
├── react-native@0.61.2
└── react-native-view-shot@3.0.2
Platform: Android
Expected behavior
Render elevation prop style on View component
Actual behavior
Elevation prop style is not rendered on View component
Steps to reproduce the behavior
1 - add elevation to a View component 2 - capture a view shot
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Native-only style props not being ignored · Issue #347 - GitHub
I am seeing this error while using react-native-experimental-navigation, which is a dependency of react-native-router-flux. elevation is an ...
Read more >Error: The `style` prop expects a mapping from style properties ...
Show activity on this post. Error: The style prop expects a mapping from style properties to values, not a string. For example, style={{ ......
Read more >View Style Props - React Native
Android. Sets the elevation of a view, using Android's underlying elevation API. This adds a drop shadow to the item and affects z-order...
Read more >Render Props - React
A component with a render prop takes a function that returns a React element and calls it instead of implementing its own render...
Read more >How To Style React Components | DigitalOcean
Each of these options relies on CSS properties. ... since you have no way of knowing what styles the children components will have....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve added an example to reproduce the issue
I’ve been trying to understand what we did wrong and I don’t see much what we can do but finding a way to tell android to draw the elevation. Because on our side we are simply using
view.draw(canvas);
.I’ve found something interesting tho and I wonder if it would help the issue: https://developer.android.com/reference/kotlin/android/graphics/Canvas.html?hl=en
The problem is this enableZ() is only available from Android 10 😑 i’m not even sure how to make conditional code in Android based on a higher version of the api
Thanks for the hardwork on this. I’m also having similar situation and tried the collapsible. I am testing on Android 6 though. If it works for Android 10+ that would be cool as most people do use those later versions.