File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 77
88import * as React from 'react' ;
99import * as ReactNativeWeb from 'react-native-web' ;
10- import { forwardRef , useRef } from 'react' ;
10+ import { forwardRef } from 'react' ;
1111import type { ViewProps } from 'react-native-web/src/exports/View/types' ;
1212import type { GenericStyleProp } from 'react-native-web/src/types' ;
1313import type { TextStyle } from 'react-native-web/src/exports/Text/types' ;
@@ -31,7 +31,10 @@ type PickerProps = {
3131} ;
3232
3333const Select = forwardRef ( ( props : any , forwardedRef ) =>
34- ReactNativeWeb . unstable_createElement ( 'select' , props ) ,
34+ ReactNativeWeb . unstable_createElement ( 'select' , {
35+ ...props ,
36+ ref : forwardedRef ,
37+ } ) ,
3538) ;
3639
3740const Picker : React$AbstractComponent < PickerProps , empty > = forwardRef <
@@ -49,8 +52,6 @@ const Picker: React$AbstractComponent<PickerProps, empty> = forwardRef<
4952 ...other
5053 } = props ;
5154
52- const hostRef = useRef ( null ) ;
53-
5455 const handleChange = React . useCallback < any > (
5556 ( e : Object ) => {
5657 const { selectedIndex, value} = e . target ;
@@ -66,7 +67,7 @@ const Picker: React$AbstractComponent<PickerProps, empty> = forwardRef<
6667 < Select
6768 disabled = { enabled === false ? true : undefined }
6869 onChange = { handleChange }
69- ref = { hostRef }
70+ ref = { forwardedRef }
7071 value = { selectedValue }
7172 { ...other }
7273 />
You can’t perform that action at this time.
0 commit comments