Skip to content

Commit 7b49e83

Browse files
maximilizeMaxs555
andauthored
fix: Fixed dynamic imports of react-native-web (#348)
Co-authored-by: max <[email protected]>
1 parent 06d6b37 commit 7b49e83

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

js/Picker.web.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
import * as React from 'react';
9+
import * as ReactNativeWeb from 'react-native-web';
910
import {forwardRef, useRef} from 'react';
1011
import type {ViewProps} from 'react-native-web/src/exports/View/types';
1112
import type {GenericStyleProp} from 'react-native-web/src/types';
@@ -30,8 +31,7 @@ type PickerProps = {
3031
};
3132

3233
const createElement =
33-
require('react-native-web').createElement ||
34-
require('react-native-web').unstable_createElement;
34+
ReactNativeWeb.createElement || ReactNativeWeb.unstable_createElement;
3535

3636
const Select = forwardRef((props: any, forwardedRef) =>
3737
createElement('select', props),

js/PickerItem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import type {ColorValue} from 'react-native/Libraries/StyleSheet/StyleSheet';
99

1010
import * as React from 'react';
11+
import * as ReactNativeWeb from 'react-native-web';
1112

1213
type Props = {
1314
color?: ColorValue,
@@ -18,8 +19,7 @@ type Props = {
1819
};
1920

2021
const createElement =
21-
require('react-native-web').createElement ||
22-
require('react-native-web').unstable_createElement;
22+
ReactNativeWeb.createElement || ReactNativeWeb.unstable_createElement;
2323

2424
const Option = (props: any) => createElement('option', props);
2525

0 commit comments

Comments
 (0)