Skip to content

Commit 9698df2

Browse files
committed
🐛 Fix uncontrolled to controlled component bug
1 parent 1ba8002 commit 9698df2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)