An open API service indexing awesome lists of open source software.

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

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)
}}
/>

)
}
}
```