async-input
v1.1.3
Published
React Debounced input
Downloads
3
Readme
📝 Table of Contents
🚀 Installation
You can install the package using yarn or npm
npm
npm install async-input
yarn
yarn add async-input
💡 Usage
import React from 'react'
import AsyncInput from 'async-input'
<AsyncInput
value={this.state.text}
nativeProps={{
type: "text",
placeholder: "wow",
}}
onChange={(text) => this.setState({ text })}
debounceTime={1000}
/>
Props
Prop | Type | Description | Default
------------ | ------------- | ------------ | -------------
elementType | string | constructs the element from the type given eg. input
or textArea
| input
onChange | function | onChange handler function to receive the input value | null
debounceTime | number | time to wait for the return value from input | 0.5s
nativeProps | object | native properties that can be passed to html input or text area, e.g. style
, className
etc | {}
⛏️ Built Using
✍️ Authors
- @umairx97 - Idea & Initial work