I am working with ReactNative-reanimated-2 I want to make an animation with an SVG path at color properties
I know how to do it in style properties with useAnimationStyle
but how can to do that with non-style properties like SVG prpos
like that
const animatedStyleColor = useAnimatedStyle(() => {
return {
color: interpolate(nimatedValue.value, [0, 50], ['blue', 'red'], {
extrapolateRight: Extrapolation.CLAMP,
}),
};
});
<Svg width={80} height={60} viewBox="0 0 8 4">
<AnimatedPath
d="M0 4l4-4 4 4"
stroke={'blue'} //here I need to animation
strokeWidth={3.5}
fill="none"
fillRule="evenodd"
strokeLinecap="round"
strokeLinejoin="round"
/>
</Svg>
but is that not work how can to make that
I figured it out. Turns out that there's a bug/issue with useAnimatedProps that is resolved by providing an empty onPress function (here's the issue):
Demo