Skip to content

Instantly share code, notes, and snippets.

@yhpark
Created July 28, 2025 08:06
Show Gist options
  • Select an option

  • Save yhpark/93b001042def3bdfb0d1a8f6a9eef68f to your computer and use it in GitHub Desktop.

Select an option

Save yhpark/93b001042def3bdfb0d1a8f6a9eef68f to your computer and use it in GitHub Desktop.
react-native-gesture-handler memory leak reproduction
import { GestureDetector } from "react-native-gesture-handler";
const Leak = () => {
const bigMemory = new Array(10000);
const pinchGesture = useMemo(() => Gesture.Pinch(), []);
const trackGesture = Gesture.Pan().onUpdate((e) => {
console.log("trackGesture", bigMemory.length);
});
const gestures = Gesture.Simultaneous(pinchGesture, trackGesture);
<GestureDetector gesture={gestures}>
<View />
</GestureDetector>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment