Skip to content

Commit 9931449

Browse files
committed
📝 Update readme
1 parent f5b86d9 commit 9931449

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@ import React, { Component } from 'react';
2323
import OtpInput from 'react-otp-input';
2424

2525
export default class App extends Component {
26+
state = {
27+
otp: '',
28+
};
29+
30+
handleChange = otp => this.setState({ otp });
31+
2632
render() {
2733
return (
2834
<div>
2935
<OtpInput
30-
onChange={otp => console.log(otp)}
36+
onChange={this.handleChange}
3137
numInputs={6}
3238
separator={<span>-</span>}
3339
/>

0 commit comments

Comments
 (0)