March 2019
Intermediate to advanced
534 pages
14h 52m
English
Finally, following is the Autocomplete component that you can reuse throughout your application:
export default function Autocomplete(props) { const classes = useStyles(); const [value, setValue] = useState(null); return ( <div className={classes.root}> <Select value={value} onChange={v => setValue(v)} textFieldProps={{ label: 'Team', InputLabelProps: { shrink: true } }} {...{ ...props, classes }} /> </div> );}Autocomplete.defaultProps = { isClearable: true, components: { Control, Menu, NoOptionsMessage, Option, Placeholder, SingleValue, ValueContainer, IndicatorSeparator, ClearIndicator, DropdownIndicator }, options: [ { label: 'Boston Bruins', value: 'BOS' }, { label: 'Buffalo Sabres', value: 'BUF' }, { label: 'Detroit ...Read now
Unlock full access