1
- // @ts -ignore
2
1
import React , { useState , useRef , useEffect } from 'react' ;
3
2
import ReactSelect , {
4
3
components as ReactSelectComponents ,
@@ -59,8 +58,10 @@ const Select: React.FC<SelectProps> = ({
59
58
action : ActionMeta < Option >
60
59
) => {
61
60
if ( ! isControlled ) {
61
+ // @ts -ignore
62
62
setInternalValue ( newValue ) ;
63
63
}
64
+ // @ts -ignore
64
65
onChange ?.( newValue , action ) ;
65
66
} ;
66
67
@@ -75,14 +76,13 @@ const Select: React.FC<SelectProps> = ({
75
76
loadOptions ? 'select-async' : ''
76
77
} ${ className || '' } `. trim ( ) ;
77
78
78
- const CustomValueContainer = ( { children , ... props } : ValueContainerProps < Option , boolean > ) => {
79
- return (
79
+ // eslint-disable-next-line no-shadow,react/no-unstable-nested-components
80
+ const CustomValueContainer = ( { children , ... props } : ValueContainerProps < Option , boolean > ) => (
80
81
< ReactSelectComponents . ValueContainer { ...props } >
81
82
{ children }
82
83
{ name && < input type = "hidden" name = { name } value = { props . getValue ( ) [ 0 ] ?. value || '' } /> }
83
84
</ ReactSelectComponents . ValueContainer >
84
85
) ;
85
- } ;
86
86
87
87
return (
88
88
< SelectComponent
@@ -97,6 +97,7 @@ const Select: React.FC<SelectProps> = ({
97
97
{ ...props }
98
98
components = { {
99
99
...ReactSelectComponents ,
100
+ // eslint-disable-next-line react/no-unstable-nested-components
100
101
Input : ( inputComponentProps : any ) => (
101
102
< ReactSelectComponents . Input
102
103
{ ...inputComponentProps }
@@ -110,9 +111,4 @@ const Select: React.FC<SelectProps> = ({
110
111
) ;
111
112
} ;
112
113
113
- // For testing purposes
114
- Select . Async = AsyncSelect ;
115
- Select . AsyncCreatable = AsyncCreatableSelect ;
116
- Select . Creatable = CreatableSelect ;
117
-
118
114
export default Select ;
0 commit comments