Skip to content

[Bug]: Crash on open()/present() - ref.current.unstable_getBoundingClientRect is not a function (Expo 55 / RN 0.83.2) #2622

@bojarovski

Description

@bojarovski

Version

v5

Reanimated Version

v3

Gesture Handler Version

v2

Platforms

Android, iOS

What happened?

When attempting to render the

BottomSheet
component while using the New Architecture (Fabric), the application immediately crashes with a TypeError.

The crash occurs inside useBoundingClientRect.ts during layout effects mount because ref.current.unstable_getBoundingClientRect is undefined. It seems React Native 0.83 / Fabric no longer exposes this specific unstable method on the ref in the way bottom-sheet is currently expecting it.

Reproduction steps

  • Reproduction steps *

Mount a screen or component containing or within your React Native app running on the New Architecture (Fabric) with React Native 0.83.2.
Call the open() or present() method via the Bottom Sheet reference.
The app crashes immediately upon trying to measure the layout during the opening animation sequence, resulting in the ref.current.unstable_getBoundingClientRect is not a function error.

Reproduction sample

https://snack.expo.dev/@mariobojarovski/f615a2

Relevant log output

ERROR  [TypeError: ref.current.unstable_getBoundingClientRect is not a function (it is undefined)] 

Call Stack
  useLayoutEffect$argument_0 (node_modules\@gorhom\bottom-sheet\src\hooks\useBoundingClientRect.ts)
  callCreate.react_stack_bottom_frame (node_modules\react-native\Libraries\Renderer\implementations\ReactFabric-dev.js)
  ...
  BottomSheet (node_modules\@gorhom\bottom-sheet\src\components\bottomSheet\BottomSheet.tsx)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions