React-native-reanimated: interpolate does not support string values for outputRange

Created on 2 Sep 2018  路  3Comments  路  Source: software-mansion/react-native-reanimated

sample code:
this.rotate=Animated.interpolate(this.animatedValue, { inputRange: [0, 1000], outputRange: ['1deg', '90deg'], })
error:
image 2018-09-02 17 35 25

Most helpful comment

It might be intentional because it can be achieved with concat

Animated.concat(
    Animated.interpolate(this.animatedValue, {
        inputRange: [0, 1000],
        outputRange: [1, 90],
    }),
    'deg',
)

All 3 comments

It might be intentional because it can be achieved with concat

Animated.concat(
    Animated.interpolate(this.animatedValue, {
        inputRange: [0, 1000],
        outputRange: [1, 90],
    }),
    'deg',
)

Thank you for this issue. I fully agree with @futuun. In RN core it's achieved via quite a dirty way and we didn't wish to follow it

Note, worth adding this to the docs

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ShaMan123 picture ShaMan123  路  3Comments

colinux picture colinux  路  3Comments

nextriot picture nextriot  路  3Comments

dinhmai74 picture dinhmai74  路  3Comments

sa8ab picture sa8ab  路  3Comments