@@ -26,7 +26,7 @@ type State = {
26
26
otp : string [ ] ,
27
27
} ;
28
28
29
- const isObject = obj => typeof obj === 'object' ;
29
+ const isStyleObject = obj => typeof obj === 'object' ;
30
30
31
31
class SingleOtpInput extends PureComponent < * > {
32
32
input : ?HTMLInputElement ;
@@ -58,7 +58,7 @@ class SingleOtpInput extends PureComponent<*> {
58
58
}
59
59
}
60
60
61
- getClasses = ( ...classes ) => classes . filter ( c => ! isObject ( c ) && c !== false ) . join ( ' ' ) ;
61
+ getClasses = ( ...classes ) => classes . filter ( c => ! isStyleObject ( c ) && c !== false ) . join ( ' ' ) ;
62
62
63
63
render ( ) {
64
64
const {
@@ -80,9 +80,9 @@ class SingleOtpInput extends PureComponent<*> {
80
80
style = { Object . assign (
81
81
{ width : '1em' , textAlign : 'center' } ,
82
82
inputStyle ,
83
- focus && isObject ( focusStyle ) && focusStyle ,
84
- isDisabled && isObject ( disabledStyle ) && disabledStyle ,
85
- hasErrored && isObject ( errorStyle ) && errorStyle
83
+ focus && isStyleObject ( focusStyle ) && focusStyle ,
84
+ isDisabled && isStyleObject ( disabledStyle ) && disabledStyle ,
85
+ hasErrored && isStyleObject ( errorStyle ) && errorStyle
86
86
) }
87
87
className = { this . getClasses (
88
88
focus && focusStyle ,
@@ -260,7 +260,7 @@ class OtpInput extends Component<Props, State> {
260
260
const { containerStyle } = this . props ;
261
261
262
262
return (
263
- < div style = { Object . assign ( { display : 'flex' } , isObject ( containerStyle ) && containerStyle ) } className = { ! isObject ( containerStyle ) && containerStyle } >
263
+ < div style = { Object . assign ( { display : 'flex' } , isStyleObject ( containerStyle ) && containerStyle ) } className = { ! isStyleObject ( containerStyle ) && containerStyle } >
264
264
{ this . renderInputs ( ) }
265
265
</ div >
266
266
) ;
0 commit comments