Skip to content

How can we reset the input value? #4

Answered by andreaswilli
kozak-iz-kh asked this question in Q&A
Discussion options

You must be logged in to vote

Starting from version 2.0.0 the value can be modified from the outside via the value prop:

const [value, setValue] = useState("");

// ...

<VerificationInput value={value} onChange={setValue} />
<button onClick={() => setValue("")}>reset</button>

Replies: 3 comments

This comment has been hidden.

This comment has been hidden.

Comment options

You must be logged in to vote
0 replies
Answer selected by andreaswilli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4 on December 08, 2020 21:30.