software-mansion / react-native-svg

SVG library for React Native, React Native Web, and plain React web projects.
MIT License
7.51k stars 1.13k forks source link

cannot drag AnimatedPath anymore on IOS after Expo SDK52 update (went from react-native-reanimated@3.10.1 to react-native-reanimated@3.16.1) #2546

Open anvarwouldnever opened 4 days ago

anvarwouldnever commented 4 days ago

Description

I'm mapping AnimatedPath elements inside GestureDetector expecting them to be draggable

const animatedProps = useAnimatedProps(() => ({
    transform: [
        { translateX: translateX.value },
        { translateY: translateY.value },
    ],
}));

return (
    <GestureDetector key={index} gesture={panGesture}>
            <AnimatedPath
                d={path.d}
                fill={path.fill}
                animatedProps={animatedProps}
                onResponderMove={(_) => {}}
            />
    </GestureDetector>
);

It's not working on IOS after Expo SDK 52 update, which puts react-native-reanimated@3.16.1 as default version of the library

Steps to reproduce

put any AnimatedPath element inside a GestureDetector and try to make it draggable, for example


const panGesture = Gesture.Pan()
    .onUpdate((event) => {
        translateX.value = event.translationX;
        translateY.value = event.translationY;
        console.log(translateX.value, translateY.value)
    });

const animatedProps = useAnimatedProps(() => ({
    transform: [
        { translateX: translateX.value },
        { translateY: translateY.value },
    ],
}));

return (
    <GestureDetector key={index} gesture={panGesture}>
            {!dragged && <AnimatedPath
                d={path.d}
                fill={path.fill}
                animatedProps={animatedProps}
                disabled={false}
            />}
    </GestureDetector>
);
github-actions[bot] commented 4 days ago

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or a link to a repository, SVG version, React Native version and Platforms sections.

github-actions[bot] commented 4 days ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?