react-native-bottom-sheet: getRefNativeTag : RN 0.72.1 error new error

Bug

Issue on React Native 0.72.1 when using GetStream and use_framework static - throw new Error happening in getRefNativeTag with Unexpected nativeTag ...

Environment info

Library Version
@gorhom/bottom-sheet 4.4.5
react-native 0.72.1
react-native-reanimated 3.3.0
react-native-gesture-handler 2.12.0
stream-chat-react-native 5.15.2

Steps To Reproduce

  1. Load app after installing getstream react native library - stream-chat-react-native v5.15.2
  2. Exception is thrown in getRefNativeTag()

Describe what you expected to happen:

  1. No exception.

Reproducible sample code

Happy if you need more examples.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 19

Most upvoted comments

This happens with new architecture

This issue was closed because it has been stalled for 5 days with no activity.

I am experiencing the same issue with BottomSheetScrollView in the new architecture. @gorhom is there any update on this?

@gorhom/bottom-sheet | 4.6.3 react-native | 0.74.3 react-native-reanimated | 3.14.0 react-native-gesture-handler | 2.17.1

True. So I commented that code out and I am good. Throwing an exception when it works without it - maybe it should be a warning?

@gorhom+bottom-sheet+4.4.5.patch

diff --git a/node_modules/@gorhom/bottom-sheet/src/utilities/getRefNativeTag.ts b/node_modules/@gorhom/bottom-sheet/src/utilities/getRefNativeTag.ts
index d4f3cc4..794a175 100644
--- a/node_modules/@gorhom/bottom-sheet/src/utilities/getRefNativeTag.ts
+++ b/node_modules/@gorhom/bottom-sheet/src/utilities/getRefNativeTag.ts
@@ -27,17 +27,17 @@ export function getRefNativeTag(ref: unknown) {
     nativeTag = ref.current._nativeTag;
   }
 
-  if (!nativeTag || typeof nativeTag !== 'number') {
-    throw new Error(
-      `Unexpected nativeTag: ${refType}; nativeTag=${nativeTag} 
+  // if (!nativeTag || typeof nativeTag !== 'number') {
+  //   throw new Error(
+  //     `Unexpected nativeTag: ${refType}; nativeTag=${nativeTag} 
 
-			createBottomSheetScrollableComponent's ScrollableComponent needs to return 
-			a reference that contains a nativeTag to a Native HostComponent.
+	// 		createBottomSheetScrollableComponent's ScrollableComponent needs to return 
+	// 		a reference that contains a nativeTag to a Native HostComponent.
 
-			ref=${ref}
-			`
-    );
-  }
+	// 		ref=${ref}
+	// 		`
+  //   );
+  // }
 
   return nativeTag;
 }

Had a similar issue with BottomSheetFlatList. Replacing it by FlatList fixed it for me