Skip to content

[Animated] Animated.View component loses shadow on animation #16870

@llanginger

Description

@llanginger

Is this a bug report?

Yes (I think!)

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS High Sierra 10.13.1
Node: 8.9.0
Yarn: 1.2.1
npm: 5.5.1
Watchman: Not Found
Xcode: Xcode 9.1 Build version 9B55
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.0.0-beta.5 => 16.0.0-beta.5
react-native: 0.49.1 => 0.49.1

Target Platform: iOS (8)

Steps to Reproduce

  1. Initialize new react-native project, import Animated and TouchableWithoutOpacity

  2. Create simple Animated function - in my case:

bounce() {
    this.springValue.setValue(0)
    Animated.spring(
        this.springValue,
        {
            toValue: 1,
            friction: 5,
            velocity: 20
        }
    ).start()
}

along with interpolation such as:

const bounceScale = this.springValue.interpolate({
    inputRange: [0, 0.5, 1],
    outputRange: [1, 0.99, 1]
})
  1. Create an Animated.View component with style props that include an animated {transform: { scale: bounceScale}} as well as shadow (offset and opacity) style props.

  2. Place the above Animated.View component inside a TouchableWithoutOpacity component and set onPress={this.bounce}

Expected Behavior

Animated.View component would, onPress, animate according to the bounce function leaving all other style props intact

Actual Behavior

Bounce function completes and removes shadow props:

Issue gif

Reproducible Demo

Snack demo: https://snack.expo.io/BkmcUs3yf

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions