react-test-li9
1.0.1 • Public • Published
npm i react-tiny-autosuggest
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>
)
}
Here're some live demos
Readme
Keywords
nonePackage Sidebar
Install
Weekly Downloads