View breaks when `shadowOffset` property is passed to the `animate` property
See original GitHub issueDescription
When I’m trying to add the shadowOffset
style property value to the animate
property in MotiView
, the view doesn’t render anymore. I’m assuming it could be because shadowOffset
has an object-based value and that is breaking something under the hood.
Steps to Reproduce
Code
<MotiView
from={{ opacity: 0 }}
animate={{
opacity: 1,
shadowColor: "#1A2138",
shadowOffset: {
width: 0,
height: 8,
},
shadowOpacity: 0.5,
shadowRadius: 20,
}}
style={{
width: 200,
height: 400,
backgroundColor: "aqua",
}}
/>
Screenshot
Expected Behaviour
Ideally, the shadow should appear as below (when applied to the regular style
property).
Code
<MotiView
from={{ opacity: 0 }}
animate={{
opacity: 1,
}}
style={{
width: 200,
height: 400,
backgroundColor: "aqua",
shadowColor: "#1A2138",
shadowOffset: {
width: 40,
height: 40,
},
shadowOpacity: 0.5,
shadowRadius: 20,
}}
/>
Screenshot
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Unable to set shadowOffset through reanimated #634 - GitHub
It may be caused when certain properties aren't listed in the config, ... View style={[ { shadowOffset: { height: new Animated.
Read more >Animatable CSS properties - CSS: Cascading Style Sheets
A CSS property is animatable if its value can be made to change over a given amount of time. Certain CSS properties can...
Read more >box-shadow - CSS-Tricks
The box-shadow property in CSS is for putting shadows on elements (sometimes referred to as "drop shadows", ala Photoshop/Figma).
Read more >Stop animating box-shadows the wrong way! - YouTube
You can animate and transition just about anything with CSS, but that doesn't mean that it's a good idea to do it.
Read more >How to animate box-shadow with silky smooth performance
How do you animate the box-shadow property in CSS without causing ... you should see something similar to this (green bars are paints; ......
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
yeah let me see. i know it can be a bit tough, there’s some magic going on in there haha
line 531 is what you want. that basically says, if the
value
for a given style is an object, then go through and applyfinal[key] = animation(value)
, whereanimation
iswithTiming
/withSpring