@axetroy/react-codebox
v0.1.0
Published
codebox component for react
Downloads
339
Readme
react-codebox
验证码输入框的 React 实现.
Install
yarn add @axetroy/react-codebox
Usage
import React, { Component } from "react";
import Codebox from "@axetroy/react-codebox";
class App extends Component {
render() {
return (
<div>
<Codebox
length={4}
validator={(input, index) => {
return /\d/.test(input);
}}
onChange={codeArray => {
console.log(codeArray);
}}
/>
</div>
);
}
}
License
The MIT License