react-test-li10

1.0.1 • Public • Published

Install

npm i react-tiny-autosuggest

Usage

import AutoSuggest from 'react-tiny-autosuggest';

render(){
  const suggestions = ['foo', 'bar'];  
  const handleSelect = selection => {console.log(selection)};

  let input;
  const handleSubmit = () => console.log(input.value);

  return (
    // without submit button
    <AutoSuggest
      suggestions = {suggestions}
      onSelect = {handleSelect}
      placeholder = "whatever..."
    />

    <form onSubmit={handleSubmit}>
      <AutoSuggest
        suggestions = {suggestions}
        onSelect = {()=>{}}
        placeholder = "whatever..."
        inputRef = { node => input = node}
    />
    </form>
  )
}

Examples

Here're some live demos

Readme

Keywords

none

Package Sidebar

Install

npm i react-test-li10

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

4.05 kB

Total Files

3

Last publish

Collaborators

  • lynnlee0522