This repository was archived by the owner on Aug 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import { Platform , requireNativeComponent , UIManager } from 'react-native' ;
2+ import { Platform , requireNativeComponent , UIManager , View } from 'react-native' ;
33
44import type { ScrollViewEnhancerProps } from './types' ;
55import { warningOnHorizontalScroll } from './utils' ;
@@ -11,14 +11,19 @@ const LINKING_ERROR =
1111 '- You are not using Expo Go\n' ;
1212
1313const ComponentName = 'ScrollViewEnhancerView' ;
14- export const NativeView =
15- UIManager . getViewManagerConfig ( ComponentName ) != null
16- ? requireNativeComponent < ScrollViewEnhancerProps > ( ComponentName )
17- : ( ) => {
18- throw new Error ( LINKING_ERROR ) ;
19- } ;
14+ export const NativeView = ( ( ) => {
15+ if ( Platform . OS === 'android' ) {
16+ return UIManager . getViewManagerConfig ( ComponentName ) != null
17+ ? requireNativeComponent < ScrollViewEnhancerProps > ( ComponentName )
18+ : ( ) => {
19+ throw new Error ( LINKING_ERROR ) ;
20+ } ;
21+ } else {
22+ return View ;
23+ }
24+ } ) ( ) ;
2025
2126export const ScrollViewEnhancerView = ( props : ScrollViewEnhancerProps ) => {
22- if ( __DEV__ ) warningOnHorizontalScroll ( props ) ;
27+ if ( __DEV__ && Platform . OS === 'android' ) warningOnHorizontalScroll ( props ) ;
2328 return < NativeView { ...props } /> ;
2429} ;
You can’t perform that action at this time.
0 commit comments