-
Notifications
You must be signed in to change notification settings - Fork 25k
Description
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
-
Initialize new react-native project, import Animated and TouchableWithoutOpacity
-
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]
})
-
Create an Animated.View component with style props that include an animated
{transform: { scale: bounceScale}}as well as shadow (offset and opacity) style props. -
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:
Reproducible Demo
Snack demo: https://snack.expo.io/BkmcUs3yf
