async-input

React Debounced input

Usage no npm install needed!

<script type="module">
  import asyncInput from 'https://cdn.skypack.dev/async-input';
</script>

README

React Async Input

Status GitHub issues open GitHub Pull Requests License

📝 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

  • React - Frontend Library
  • Babel - Use next generation JavaScript, today.
  • Webpack - Javascript Bundler

✍️ Authors