I'm trying to animate an SVG path's length form 0 to it's full length in React Native Reanimated 2. Here is my sample path:
const AnimatedPath = Animated.createAnimatedComponent(Path);
const animatedProps = useAnimatedProps(() => {
const path =
`M${width * 0.182} ${height * 0.59} ` +
`L${width * 0.443} ${height * 0.59} ` +
`L${width * 0.443} ${height * 0.39} `;
return {
d: path,
};
});
return (
<Svg height="100%" width="100%">
<AnimatedPath animatedProps={animatedProps} fill="none" stroke="red" strokeWidth="5" />
</Svg>
);
I have tried adding some interpolation to the width of the path with no luck. I have also tried looking at the interpolatePath() implementation from Redash but it seems to take in two paths as the output range. Anything else I should look at?