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.

`shadowOffset` is reset when an `Animated.View` is animated

See original GitHub issue

Is this a bug report?

Yes.

Have you read the Bugs section of the Contributing to React Native Guide?

Yes.

Environment

iOS, and on snack.expo.io

  1. Target Platform (e.g. iOS, Android): iOS
  2. Development Operating System (e.g. macOS Sierra, Windows 10): macOS Sierra
  3. Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant): Xcode, snack.expo.io

Steps to Reproduce

  1. Render an Animated.View with a shadow and shadowOffset (eg. {width: 10, height: 10})
  2. Animate any transform with an Animated.Value
  3. Observe shadowOffset is affected. (shadowOpacity, and shadowRadius are unaffected)

https://snack.expo.io/rkBBhJ3Nb

Expected Behavior

shadowOffset should persist

Actual Behavior

shadowOffset does not persist

Reproducible Demo

https://snack.expo.io/rkBBhJ3Nb

Note: none of the shadow properties are being animated.

A way to fix this is to wrap the styled-shadowed View with an Animated.View and animate that instead.

@janicduplessis any thoughts?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:12
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
mikehobicommented, Oct 23, 2017

Both those workarounds are great. But there’s still a bug

1reaction
BFriedrichscommented, Oct 20, 2017

Another solution to this is wrapping the content of the Animatable into another View and applying the shadowOffset to it. https://github.com/oblador/react-native-animatable/issues/133

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue in React Native shadow animation on panresponder
I want to apply animation in shadow like when user try to scroll down at that time shadow should be show dark when...
Read more >
Create frame animations in Photoshop - Adobe Support
Select one or more frames in the Timeline panel. Click the Delay value below the selected frame to view the pop‑up menu.
Read more >
Using the Animation view - Unity - Manual
Use the Animation view to preview and edit Animation Clips for animated GameObjects in Unity. To open the Animation view in Unity, go...
Read more >
animation-direction - CSS: Cascading Style Sheets | MDN
In other words, each time the animation cycles, the animation will reset to the beginning state and start over again.
Read more >
Animating Scenes - SketchUp Help
With SketchUp's animation feature, you can watch the shadow transition from ... To customize the animation, select View > Animation > Settings or...
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