react-otp-input-2
Version:
Updated version of react-otp-input with bug fixes.
40 lines (28 loc) • 844 B
Markdown
> Updated version of react-otp-input with bug fixes.
[](https://www.npmjs.com/package/react-otp-input-2) [](https://standardjs.com)
```bash
npm install --save react-otp-input-2
```
```jsx
import React, { Component } from 'react';
import OtpInput from 'react-otp-input';
export default class App extends Component {
state = { otp: '' };
handleChange = (otp) => this.setState({ otp });
render() {
return (
<OtpInput
value={this.state.otp}
onChange={this.handleChange}
numInputs={6}
separator={<span>-</span>}
/>
);
}
}
```
MIT © [shubhlpu16](https://github.com/shubhlpu16)