about summary refs log tree commit diff
path: root/modules/bottom-sheet/src/BottomSheet.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-11-10 23:03:55 +0000
committerGitHub <noreply@github.com>2024-11-10 23:03:55 +0000
commit9247407c70eff280768e605637be873052ac1b59 (patch)
treeaf6ae552122b401d279f0e244aba6aeedaa58d03 /modules/bottom-sheet/src/BottomSheet.tsx
parent9a10af7117ff2c818a137241a5b4271c2a882f10 (diff)
downloadvoidsky-9247407c70eff280768e605637be873052ac1b59.tar.zst
Don't render unnecessary <Portal> instances (#6217)
Diffstat (limited to 'modules/bottom-sheet/src/BottomSheet.tsx')
-rw-r--r--modules/bottom-sheet/src/BottomSheet.tsx25
1 files changed, 1 insertions, 24 deletions
diff --git a/modules/bottom-sheet/src/BottomSheet.tsx b/modules/bottom-sheet/src/BottomSheet.tsx
index bcc2c42ad..8da2773e9 100644
--- a/modules/bottom-sheet/src/BottomSheet.tsx
+++ b/modules/bottom-sheet/src/BottomSheet.tsx
@@ -1,24 +1 @@
-import React from 'react'
-
-import {BottomSheetViewProps} from './BottomSheet.types'
-import {BottomSheetNativeComponent} from './BottomSheetNativeComponent'
-import {useBottomSheetPortal_INTERNAL} from './BottomSheetPortal'
-
-export const BottomSheet = React.forwardRef<
-  BottomSheetNativeComponent,
-  BottomSheetViewProps
->(function BottomSheet(props, ref) {
-  const Portal = useBottomSheetPortal_INTERNAL()
-
-  if (__DEV__ && !Portal) {
-    throw new Error(
-      'BottomSheet: You need to wrap your component tree with a <BottomSheetPortalProvider> to use the bottom sheet.',
-    )
-  }
-
-  return (
-    <Portal>
-      <BottomSheetNativeComponent {...props} ref={ref} />
-    </Portal>
-  )
-})
+export {BottomSheetNativeComponent as BottomSheet} from './BottomSheetNativeComponent'