https://github.com/suhaotian/react-input
input with compositionStart,compositionUpdate,compositionEnd for ime like Chinese input
https://github.com/suhaotian/react-input
Last synced: 5 months ago
JSON representation
input with compositionStart,compositionUpdate,compositionEnd for ime like Chinese input
- Host: GitHub
- URL: https://github.com/suhaotian/react-input
- Owner: suhaotian
- Created: 2016-05-31T06:46:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-13T17:59:55.000Z (over 9 years ago)
- Last Synced: 2025-05-10T16:02:47.824Z (7 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 10
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-input
See https://github.com/facebook/react/issues/3926
## Usage
```shell
npm install lodash --save # for debounce util
```
```js
import React, { Component } from 'react'
import Input from './index'
class New extends Component {
constructor(props) {
super(props)
this.state = {
value: ''
}
this.handleChange = this.handleChange.bind(this)
}
handleChange(value) {
this.setState({value})
}
render() {
return (
You type: {this.state.value}
{ // refc for ref
this._input = c // you can access input DOM node with this._input
}}
onChange={value => {
this.handleChange(value)
}}
/>
)
}
}
```