$ git show swipe-delete
Swipe to delete
Swipe a row left to reveal a delete action; collapse the row when removed.
import { scheduleOnRN } from 'react-native-worklets';
const x = useSharedValue(0);
const pan = Gesture.Pan()
.activeOffsetX([-10, 10])
.onUpdate(e => { x.value = Math.min(0, e.translationX); })
.onEnd(() => {
if (x.value < -160) scheduleOnRN(onDelete, id);
else x.value = withSpring(x.value < -60 ? -80 : 0);
});
const row = useAnimatedStyle(() => ({ transform: [{ translateX: x.value }] }));
// wrap the row in <Animated.View exiting={FadeOut} layout={LinearTransition}>