diff --git a/src/components/Screen.tsx b/src/components/Screen.tsx index 2d451acbeb..f8905e3bfb 100644 --- a/src/components/Screen.tsx +++ b/src/components/Screen.tsx @@ -26,7 +26,7 @@ type NativeScreenProps = Omit< sheetLargestUndimmedDetent: number; }; -export const NativeScreen: React.ComponentType = +const NativeScreen: React.ComponentType = ScreenNativeComponent as React.ComponentType; const AnimatedNativeScreen = Animated.createAnimatedComponent(NativeScreen); const AnimatedNativeModalScreen = Animated.createAnimatedComponent( diff --git a/src/components/ScreenContainer.tsx b/src/components/ScreenContainer.tsx index c61b24eadf..aed0cc92c3 100644 --- a/src/components/ScreenContainer.tsx +++ b/src/components/ScreenContainer.tsx @@ -9,13 +9,6 @@ import { isNativePlatformSupported, screensEnabled } from '../core'; import ScreenContainerNativeComponent from '../fabric/ScreenContainerNativeComponent'; import ScreenNavigationContainerNativeComponent from '../fabric/ScreenNavigationContainerNativeComponent'; -export const NativeScreenContainer: React.ComponentType = - Platform.OS !== 'web' ? (ScreenContainerNativeComponent as any) : View; -export const NativeScreenNavigationContainer: React.ComponentType = - Platform.OS !== 'web' - ? (ScreenNavigationContainerNativeComponent as any) - : View; - function ScreenContainer(props: ScreenContainerProps) { const { enabled = screensEnabled(), hasTwoStates, ...rest } = props; @@ -23,11 +16,11 @@ function ScreenContainer(props: ScreenContainerProps) { if (hasTwoStates) { const ScreenNavigationContainer = Platform.OS === 'ios' - ? NativeScreenNavigationContainer - : NativeScreenContainer; + ? ScreenNavigationContainerNativeComponent + : ScreenContainerNativeComponent; return ; } - return ; + return ; } return ; } diff --git a/src/components/ScreenContainer.web.tsx b/src/components/ScreenContainer.web.tsx index 08c29242fe..769ad63699 100644 --- a/src/components/ScreenContainer.web.tsx +++ b/src/components/ScreenContainer.web.tsx @@ -1,6 +1,5 @@ import { View } from 'react-native'; -export const NativeScreenContainer = View; -export const NativeScreenNavigationContainer = View; +const ScreenContainer = View; -export default View; +export default ScreenContainer; diff --git a/src/components/ScreenContentWrapper.tsx b/src/components/ScreenContentWrapper.tsx index e7e1c8be3d..95dae06887 100644 --- a/src/components/ScreenContentWrapper.tsx +++ b/src/components/ScreenContentWrapper.tsx @@ -1,12 +1,9 @@ import React from 'react'; -import { Platform, View, ViewProps } from 'react-native'; +import { ViewProps } from 'react-native'; import ScreenContentWrapperNativeComponent from '../fabric/ScreenContentWrapperNativeComponent'; -export const NativeScreenContentWrapper: React.ComponentType = - Platform.OS !== 'web' ? (ScreenContentWrapperNativeComponent as any) : View; - function ScreenContentWrapper(props: ViewProps) { - return ; + return ; } export default ScreenContentWrapper; diff --git a/src/components/ScreenContentWrapper.web.tsx b/src/components/ScreenContentWrapper.web.tsx index 93474d280b..4e01239169 100644 --- a/src/components/ScreenContentWrapper.web.tsx +++ b/src/components/ScreenContentWrapper.web.tsx @@ -1,6 +1,5 @@ import { View } from 'react-native'; -export const NativeScreenContentWrapper = View; - const ScreenContentWrapper = View; + export default ScreenContentWrapper; diff --git a/src/components/ScreenFooter.tsx b/src/components/ScreenFooter.tsx index 3e2485bbda..2241f5afb6 100644 --- a/src/components/ScreenFooter.tsx +++ b/src/components/ScreenFooter.tsx @@ -1,18 +1,12 @@ import React from 'react'; -import { Platform, View, ViewProps } from 'react-native'; +import { ViewProps } from 'react-native'; import ScreenFooterNativeComponent from '../fabric/ScreenFooterNativeComponent'; -/** - * Unstable API - */ -export const NativeScreenFooter: React.ComponentType = - Platform.OS !== 'web' ? (ScreenFooterNativeComponent as any) : View; - /** * Unstable API */ function ScreenFooter(props: ViewProps) { - return ; + return ; } export default ScreenFooter; diff --git a/src/components/ScreenFooter.web.tsx b/src/components/ScreenFooter.web.tsx index b8dd6df383..33030a09ba 100644 --- a/src/components/ScreenFooter.web.tsx +++ b/src/components/ScreenFooter.web.tsx @@ -1,6 +1,5 @@ import { View } from 'react-native'; -export const NativeScreenFooter = View; - const ScreenFooter = View; + export default ScreenFooter; diff --git a/src/components/ScreenStack.web.tsx b/src/components/ScreenStack.web.tsx index f20f2993ac..12d790f75b 100644 --- a/src/components/ScreenStack.web.tsx +++ b/src/components/ScreenStack.web.tsx @@ -1,3 +1,5 @@ import { View } from 'react-native'; -export default View; +const ScreenStack = View; + +export default ScreenStack; diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar.tsx index a26c51c2e4..19159c145d 100644 --- a/src/components/SearchBar.tsx +++ b/src/components/SearchBar.tsx @@ -15,13 +15,13 @@ import SearchBarNativeComponent, { } from '../fabric/SearchBarNativeComponent'; import { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes'; -export const NativeSearchBar: React.ComponentType< +const NativeSearchBar: React.ComponentType< SearchBarNativeProps & { ref?: React.RefObject } > & typeof NativeSearchBarCommands = SearchBarNativeComponent as unknown as React.ComponentType & SearchBarCommandsType; -export const NativeSearchBarCommands: SearchBarCommandsType = +const NativeSearchBarCommands: SearchBarCommandsType = SearchBarNativeCommands as SearchBarCommandsType; type NativeSearchBarRef = React.ElementRef; diff --git a/src/components/SearchBar.web.tsx b/src/components/SearchBar.web.tsx index 5e93c5f4f9..f5d26a34b0 100644 --- a/src/components/SearchBar.web.tsx +++ b/src/components/SearchBar.web.tsx @@ -1,6 +1,5 @@ import { View } from 'react-native'; -export const NativeSearchBar = View; -export const NativeSearchBarCommands = View; +const SearchBar = View; -export default View; +export default SearchBar; diff --git a/src/index.tsx b/src/index.tsx index c8465cab71..a4a3f3e5b6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -15,19 +15,10 @@ export { */ export { default as Screen, - NativeScreen, InnerScreen, ScreenContext, } from './components/Screen'; -export { - default as ScreenContainer, - NativeScreenContainer, - NativeScreenNavigationContainer, -} from './components/ScreenContainer'; - -export { default as ScreenStack } from './components/ScreenStack'; - export { ScreenStackHeaderConfig, ScreenStackHeaderSubview, @@ -38,28 +29,12 @@ export { ScreenStackHeaderSearchBarView, } from './components/ScreenStackHeaderConfig'; -export { - default as SearchBar, - NativeSearchBar, - NativeSearchBarCommands, -} from './components/SearchBar'; - +export { default as SearchBar } from './components/SearchBar'; +export { default as ScreenContainer } from './components/ScreenContainer'; +export { default as ScreenStack } from './components/ScreenStack'; export { default as FullWindowOverlay } from './components/FullWindowOverlay'; - -export { - default as ScreenFooter, - NativeScreenFooter, -} from './components/ScreenFooter'; - -export { - default as ScreenContentWrapper, - NativeScreenContentWrapper, -} from './components/ScreenContentWrapper'; - -/** - * Modules - */ -export { default as NativeScreensModule } from './fabric/NativeScreensModule'; +export { default as ScreenFooter } from './components/ScreenFooter'; +export { default as ScreenContentWrapper } from './components/ScreenContentWrapper'; /** * Contexts