Open
Description
const interpolatedValue = Animated.interpolate(animatedValue, [0.0, 1.0], ['0', '-5'])
The typed values in the second array are supposed to be strings. However Android doesn't like that.
Changing above strings to numbers does work! But TypeScript complains about it.
// Works in iOS
const interpolatedValue = Animated.interpolate(animatedValue, [0.0, 1.0], ['0', '-5'])
const animatedStyle = Styles.createAnimatedViewStyle({
transform: [{ translateY: interpolatedValue }],
})
return (
<View style={styles.loadingWrapper}>
<Animated.View style={[styles.loadingDot, animatedStyle]} />
</View>
)
The type is as follows:
let interpolate: (value: Animated.Value, inputRange: number[], outputRange: string[]) => Animated.Value
Edit: I've now tried Android, iOS, and web. All 3 work with just a number. Is this just a mis-typed parameter, or is there any other reason it was made a string?