1.0.1 • Published 5 years ago
react-restrict-input v1.0.1
react-restrict-input
Input box that can limit the length and character of user input, support paste and Chinese input
Install
npm install --save react-restrict-inputUsage
import React, { Component } from 'react'
import { ReactRestrictInput } from 'react-restrict-input'
const App = () => {
  const [value, setValue] = React.useState('')
  return (
    <ReactRestrictInput
      value={value}
      onChange={setValue}
      maxChars={10}
      restrict={/[0-9a-z我]/}
    />
  )
}License
MIT © tkitesy