debounce-input-react
v1.1.1
Published
React component that renders Input with debounced onInput
Downloads
50
Maintainers
Readme
debounce-input-react ·
Installation
NPM
npm install debounce-input-react --save
Usage
import React from 'react';
import ReactDOM from 'react-dom';
import {DebounceInput} from 'debounce-input-react';
class App extends React.Component {
state = {
value: ''
};
render() {
return (
<div>
<DebounceInput
minLength={2}
debounceTimeout={300}
onInput={event => this.setState({value: event.target.value})} />
<p>Result: {this.state.value}</p>
</div>
);
}
}
const appRoot = document.createElement('div');
document.body.appendChild(appRoot);
ReactDOM.render(<App />, appRoot);
License
debouce-input-react is MIT licensed.