Skip to content

Commit f79ad17

Browse files
author
eyal0803
authored
Don't pass shouldAutoFocus to <input />
When passing custom props to HTML components React will throw a warning that says it doesn't recognize this prop. Since the prop is camel-cased (`shouldAutoFocus`), as opposed to lower-case (`shouldautofocus`), React tries to recognize it instead of just pass it to the DOM element. The solution is the deconstructure it along with the used props so it won't get passed in `{...rest}`.
1 parent 785280c commit f79ad17

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lib/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class SingleOtpInput extends PureComponent<*> {
7575
errorStyle,
7676
focusStyle,
7777
disabledStyle,
78+
shouldAutoFocus,
7879
...rest
7980
} = this.props;
8081

0 commit comments

Comments
 (0)