@@ -26,7 +26,7 @@ type State = {
2626 otp : string [ ] ,
2727} ;
2828
29- const isObject = obj => typeof obj === 'object' ;
29+ const isStyleObject = obj => typeof obj === 'object' ;
3030
3131class SingleOtpInput extends PureComponent < * > {
3232 input : ?HTMLInputElement ;
@@ -58,7 +58,7 @@ class SingleOtpInput extends PureComponent<*> {
5858 }
5959 }
6060
61- getClasses = ( ...classes ) => classes . filter ( c => ! isObject ( c ) && c !== false ) . join ( ' ' ) ;
61+ getClasses = ( ...classes ) => classes . filter ( c => ! isStyleObject ( c ) && c !== false ) . join ( ' ' ) ;
6262
6363 render ( ) {
6464 const {
@@ -80,9 +80,9 @@ class SingleOtpInput extends PureComponent<*> {
8080 style = { Object . assign (
8181 { width : '1em' , textAlign : 'center' } ,
8282 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
8686 ) }
8787 className = { this . getClasses (
8888 focus && focusStyle ,
@@ -260,7 +260,7 @@ class OtpInput extends Component<Props, State> {
260260 const { containerStyle } = this . props ;
261261
262262 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 } >
264264 { this . renderInputs ( ) }
265265 </ div >
266266 ) ;
0 commit comments