default option selected autocomplete material ui code example

Example 1: autocomplete default value material-ui

<Autocomplete
    id="id"
    options={Options}
    getOptionLabel={option => option.label}
    defaultvalue={Options.find(v => v.label[0])} 
    renderInput={params => (
      <TextField {...params} label="label" variant="outlined" />
    )}
  />

Example 2: material ui autocomple how make first option is selected as default

<Autocomplete
    id="id"
    options={Options}
    getOptionLabel={option => option.label}
    defaultValue={Options.find(v => v.label[0])} 
    renderInput={params => (
      <TextField {...params} label="label" variant="outlined" />
    )}
  />

Tags:

Misc Example