Skip to content

Fix for ERROR ReanimatedError: Cannot read property '__remoteFunction' of undefined, js engine: reanimated #1336

@levipro

Description

@levipro
          @gorhom I have resolved the error ` ERROR  ReanimatedError: Cannot read property '__remoteFunction' of undefined, js engine: reanimated` by defining the callback for `runOnJS` with an arrow function:
diff --git a/node_modules/@gorhom/bottom-sheet/src/hooks/useGestureEventsHandlersDefault.tsx b/node_modules/@gorhom/bottom-sheet/src/hooks/useGestureEventsHandlersDefault.tsx
index b44bfa5..0b029d3 100644
--- a/node_modules/@gorhom/bottom-sheet/src/hooks/useGestureEventsHandlersDefault.tsx
+++ b/node_modules/@gorhom/bottom-sheet/src/hooks/useGestureEventsHandlersDefault.tsx
@@ -44,6 +44,10 @@ export const useGestureEventsHandlersDefault: GestureEventsHandlersHookType =
     } = useBottomSheetInternal();
     //#endregion
 
+    const dismissKeyboard = () => {
+      Keyboard.dismiss();
+    };
+
     //#region gesture methods
     const handleOnStart: GestureEventHandlerCallbackType<GestureEventContextType> =
       useWorkletCallback(
@@ -296,7 +300,7 @@ export const useGestureEventsHandlersDefault: GestureEventsHandlersHookType =
                 absoluteY > WINDOW_HEIGHT - animatedKeyboardHeight.value
               )
             ) {
-              runOnJS(Keyboard.dismiss)();
+              runOnJS(dismissKeyboard)();
             }
           }
 

Originally posted by @levipro in #1324 (comment)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions