question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Elevation prop style is not rendered on View component

See original GitHub issue

bug 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:open
  • Created 4 years ago
  • Reactions:4
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
grecommented, Jan 19, 2020

I’ve added an example to reproduce the issue

Capture d’écran 2020-01-19 à 16 42 25

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

0reactions
Noitidartcommented, Dec 30, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found