react-rjkj

1.2.20 • Public • Published

Install

npm i react-rjkj-packs

Usage

import {AutoSuggest} from 'react-rjkj-packs';

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

Dependents (0)

Package Sidebar

Install

npm i react-rjkj

Weekly Downloads

0

Version

1.2.20

License

ISC

Unpacked Size

400 kB

Total Files

4

Last publish

Collaborators

  • dingxuan