Join the conversation

Sign in to join this conversation, and others like it, in the communities you care about.

Popmotion

Help and discussion for Popmotion's animation libraries: Popmotion, Pose, React Pose, React Native Pose, etc

Popmotion / General

Animate Shadow in react-native

Animate Shadow in react-native

Popmotion / General · June 16, 2018 at 4:49pm
This might be possible and I'm just doing it wrong, but I'm currently trying to animate shadows in react native and not having much luck. I'm trying with the following:
const poseConfig = { down: { shadowOpacity: 1, shadowRadius: 1 }, up: { shadowOpacity: 0.5, shadowRadius: 4, } }


June 18, 2018 at 8:40am

I've never tried this but do you need to add shadowOffset too?

  • reply
  • like

June 18, 2018 at 4:43pm

yeah, its there directly on the element. Part of the problem is I find it pretty unclear how shadows are suppose to work in RN. For example, no shadow props are listed here: https://facebook.github.io/react-native/docs/view-style-props.html#props

  • reply
  • like

These props seem to work when passes in styles and when passed directly onto the view component

  • reply
  • like

I

  • reply
  • like

I'm able to get it partially working, but keep running into https://cl.ly/3P3N2W1h3i2d

  • reply
  • like

looks like I can get shadowOpacity and shadowRadius working if animated alone. I'll keep playing. I'll probably end up just animating opacity on elements with static shadows at this point to get things happy :)

  • reply
  • like
Your message here...

*bold*_italic_`code````codeblock```