diff --git a/src/handlers/gestures/GestureDetector/index.tsx b/src/handlers/gestures/GestureDetector/index.tsx index 0f57b9c1ee..d002cb9315 100644 --- a/src/handlers/gestures/GestureDetector/index.tsx +++ b/src/handlers/gestures/GestureDetector/index.tsx @@ -1,5 +1,11 @@ /* eslint-disable react/no-unused-prop-types */ -import React, { useContext, useEffect, useMemo, useRef } from 'react'; +import React, { + useContext, + useEffect, + useLayoutEffect, + useMemo, + useRef, +} from 'react'; import { Platform, findNodeHandle } from 'react-native'; import { GestureType } from '../gesture'; import { UserSelect, TouchAction } from '../../gestureHandlerCommon'; @@ -141,7 +147,7 @@ export const GestureDetector = (props: GestureDetectorProps) => { useAnimatedGesture(preparedGesture, needsToRebuildReanimatedEvent); - useEffect(() => { + useLayoutEffect(() => { const viewTag = findNodeHandle(state.viewRef) as number; preparedGesture.isMounted = true;