@reactmaker/react-autocorrect-input

1.0.2 • Public • Published

React Autocorrect Input Component

Autocorrect input react component, suggested text when you type in.

screenshoot

Doc

https://reactmaker.github.io/react-autocorrect-input/

requirement

  • React 16.4^

Download from NPM

npm install @reactmaker/react-autocorrect-input

How to use

import React from 'react';
import { render } from 'react-dom';
import { hot } from 'react-hot-loader';
import Input from '@reactmaker/react-autocorrect-input';

class Demo extends React.Component {
  state = {
    value: '',
    dataSource: ['apple', 'ask', 'applice', 'best', 'book', 'beep', 'cat', 'can', 'car'],
  }

  onChange = (value) => this.setState({ value })

  render() {
    const { value, dataSource } = this.state;
    return (
      <Input onChange={this.onChange} value={value} dataSource={dataSource} />
    );
  }
}

const Main = hot(module)(Demo);

render(<Main />, document.getElementById('app'));

Dependencies (4)

Dev Dependencies (45)

Package Sidebar

Install

npm i @reactmaker/react-autocorrect-input

Weekly Downloads

4

Version

1.0.2

License

MIT

Unpacked Size

652 kB

Total Files

14

Last publish

Collaborators

  • bbandydd
  • chnbohwr