i'm trying to animate color of Text, something like this:
const animateTest = scrollY.interpolate({
inputRange: [0, 100],
outputRange: ['rgba(255,0,0,1)', 'rgba(0,255,0,1)']
});
return (<View>
<Animated.Text style={{ position:'absolute',
color: animateTest
}} >blah blah blah</Animated.Text>
<Animated.ScrollView
scrollEventThrottle={16}
onScroll={Animated.event(
[
{
nativeEvent: {contentOffset: {y: scrollY}},
},
],
{
useNativeDriver: true,
}
)}
>
but i'm getting this error:
Style property 'color' is not supported by native animated module
using ReactNative 0.44.0
according to this blog post it's supposed to work because they say:
Not everything you can do with Animated is currently supported in Native Animated. The main limitation is that you can only animate non-layout properties, things like transform, opacity and backgroundColor will work but flexbox and position properties won't.
but i see there is a whitelist for styles in the code that are supported: link to relevant code there is a very limited whitelist:
const STYLES_WHITELIST = {
opacity: true,
transform: true,
/* legacy android transform properties */
scaleX: true,
scaleY: true,
translateX: true,
translateY: true,
};
which does not include color/backgroundColor
can anybody help me out here - is it supposed to be supported or not?