Skip to content

Commit

Permalink
fix(web): don't extract _nativeTag in bottomSheet for web
Browse files Browse the repository at this point in the history
Fixes #27
  • Loading branch information
remarkablemark authored and stanleyugwu committed Sep 10, 2024
1 parent b4b3455 commit d7a1767
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/components/bottomSheet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,15 @@ const BottomSheet = forwardRef<BottomSheetMethods, BottomSheetProps>(
/**
* Extracts and caches the _nativeTag property of ContentWrapper
*/
let extractNativeTag = useCallback(
// @ts-expect-error
({ target: { _nativeTag: tag = undefined } }: LayoutChangeEvent) => {
if (!cachedContentWrapperNativeTag.current)
cachedContentWrapperNativeTag.current = tag;
},
[]
);
let extractNativeTag = useCallback(({ target }: LayoutChangeEvent) => {
const tag =
Platform.OS === 'web'
? undefined
: // @ts-expect-error
target?._nativeTag;
if (!cachedContentWrapperNativeTag.current)
cachedContentWrapperNativeTag.current = tag;
}, []);

/**
* Expands the bottom sheet.
Expand Down

0 comments on commit d7a1767

Please sign in to comment.