Skip to content

Commit 2c243d4

Browse files
authored
Merge pull request #12 from devfolioco/fix-ctrl-comp
Fix uncontrolled to controlled input error
2 parents 1ba8002 + 497c6bc commit 2c243d4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-otp-input",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "A fully customizable, one-time password input component for the web built with React",
55
"main": "lib/index.js",
66
"scripts": {

src/lib/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class SingleOtpInput extends PureComponent<*> {
7878
disabledStyle,
7979
shouldAutoFocus,
8080
isInputNum,
81+
value,
8182
...rest
8283
} = this.props;
8384

@@ -105,6 +106,7 @@ class SingleOtpInput extends PureComponent<*> {
105106
this.input = input;
106107
}}
107108
disabled={isDisabled}
109+
value={value ? value : ''}
108110
{...rest}
109111
/>
110112
{!isLastChild && separator}

0 commit comments

Comments
 (0)