Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

view has a shadow set but cannot calculate shadow efficiently

Tags:

react-native

I'm getting this error message:

>View #54 of type RCTView has a shadow set but cannot calculate shadow efficiently.

The error message is clear, except that I don't know which view is #54?!?

Is there a way to figure out to which view react native is referring to with this numbering system?

like image 248
Pavle Lekic Avatar asked Nov 18 '25 12:11

Pavle Lekic


1 Answers

This is because you are setting the backgroundColor as transparent rgba(255, 255, 255, 0.0). This is very inefficient. You can read all about this in this commit log https://github.com/facebook/react-native/commit/e4c53c28aea7e067e48f5c8c0100c7cafc031b06

You can delete shadowOpacity, add it to the shadow color, and use an RGBA value.

shadowColor: 'rgba(0,0,0, 0.1)'
like image 91
Santiago Siordia Avatar answered Nov 21 '25 09:11

Santiago Siordia