test-library-hybird-libs
v1.0.5
Published
react tiny auto suggest component
Downloads
10
Readme
Install
npm i test-library-hybird-libsUsage
import Checkout from 'test-library-hybird-libs';
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>
)
}
