@livelybone/react-input
v2.5.0
Published
A react input component, realized input validator, formatter. `textarea` available
Downloads
28
Maintainers
Readme
@livelybone/react-input
pkg.module supported
, which means that you can apply tree-shaking in you project
A react input component, default to disabled change event when composition event triggered
repository
https://github.com/livelybone/react-input.git
Demo
https://github.com/livelybone/react-input#readme
Run Example
Your can see the usage by run the example of the module, here is the step:
- Clone the library
git clone https://github.com/livelybone/react-input.git
- Go to the directory
cd your-module-directory
- Install npm dependencies
npm i
(use taobao registry:npm i --registry=http://registry.npm.taobao.org
) - Open service
npm run dev
- See the example(usually is
http://127.0.0.1/examples/test.html
) in your browser
Installation
npm i -S @livelybone/react-input
Global name
ReactInput
Interface
See in index.d.ts
Usage
import React from 'react'
import ReactInput from '@livelybone/react-input'
const Comp = () => {
return (
<ReactInput
type="text"
shouldCompositionEventTriggerChangeEvent={false}
onChange={(ev) => console.log('onChange', ev, ev.target.value, ev.type)}
onCompositionEnd={(ev) => {
console.log('onCompositionEnd', ev.target.value, ev)
}}
/>
)
}
Use in html, see what your can use in CDN: unpkg
<script src="https://unpkg.com/@livelybone/react-input/lib/umd/index.js"></script>