Created
July 28, 2025 08:06
-
-
Save yhpark/93b001042def3bdfb0d1a8f6a9eef68f to your computer and use it in GitHub Desktop.
react-native-gesture-handler memory leak reproduction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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