import * as React from 'react'; import TextField from '@mui/material/TextField'; import Autocomplete from '@mui/material/Autocomplete'; const options = ['Option 1', 'Option 2']; export default function ControllableStates() { const [value, setValue] = React.useState(options[0]); const [inputValue, setInputValue] = React.useState(''); return (
{`value: ${value !== null ? `'${value}'` : 'null'}`}
{`inputValue: '${inputValue}'`}

{ setValue(newValue); }} inputValue={inputValue} onInputChange={(event, newInputValue) => { setInputValue(newInputValue); }} id="controllable-states-demo" options={options} sx={{ width: 300 }} renderInput={(params) => } />
); }