import * as React from 'react'; import Autocomplete from 'components/autocomplete'; class AutocompleteTest extends React.Component { state: any = { simple: 'Spain', simpleShowAll: 'England', multipleArray: ['ES-es', 'TH-th'], multipleObject: {'ES-es': 'Spain', 'TH-th': 'Thailand'}, countriesArray: ['Spain', 'England', 'USA', 'Thailand', 'Tongo', 'Slovenia'], countriesObject: { 'EN-gb': 'England', 'EN-en': 'United States of America', 'EN-nz': 'New Zealand' } }; handleFocus = (event: React.MouseEvent) => { console.log('This is focused'); console.log(event); }; handleMultipleArrayChange = (value: any) => { this.setState({ multipleArray: value, countriesObject: { ...this.state.countriesObject, ...(value[0] && !this.state.countriesObject[value[0]]) ? {[value[0]]: value[0]} : {} } }); }; handleMultipleObjectChange = (value: any) => { this.setState({ multipleObject: value }); }; handleSimpleChange = (value: any) => { this.setState({simple: value}); }; handleSimpleShowAllChange = (value: any) => { this.setState({simpleShowAll: value}); }; render () { return (
Autocomplete

You can have a multiple or simple autocomplete.

); } } export default AutocompleteTest;