From 18c2f205c73e9e72be562b875a7cecc28bc7568e Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Tue, 28 May 2024 10:15:41 +0200 Subject: [PATCH] Fix the funny thing --- src/handlers/gestures/GestureDetector/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/handlers/gestures/GestureDetector/index.tsx b/src/handlers/gestures/GestureDetector/index.tsx index 18f5ef8827..aa8e454aa2 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 { GestureType } from '../gesture'; import { findNodeHandle, @@ -145,7 +151,7 @@ export const GestureDetector = (props: GestureDetectorProps) => { useAnimatedGesture(preparedGesture, needsToRebuildReanimatedEvent); - useEffect(() => { + useLayoutEffect(() => { const viewTag = findNodeHandle(state.viewRef) as number; preparedGesture.isMounted = true;