title: Material UI Autocomplete not updating input value (React)
body: <p>I made an Autocomplete component in React using Material UI's Autocomplete component. Here's the code</p>
  <pre><code>import { useState } from &quot;react&quot;;
  import { Autocomplete as MuiAutcomplete } from &quot;@mui/material&quot;;
  import {useFormContext} from &quot;react-hook-form&quot;;
  
  
  interface props {
      name: string,
      options?: string[],
      getOptions?: (value: string) =&gt; {
          label: string,
          id: number
      }[] | string[],
      freeSolo?: boolean
  };
  
  const Autocomplete = ({name, options=[], getOptions, freeSolo=false}: props) =&gt; {
      const [autocompleteValues, setAutocompleteValues] = useState&lt;any[]&gt;(options);
      const {setValue, getValues} = useFormContext();
  
      return (
          &lt;MuiAutcomplete
              options={autocompleteValues}
              renderInput={({ InputProps, inputProps }) =&gt; (
                  &lt;div ref={InputProps.ref}&gt;
                  &lt;input
                      type=&quot;text&quot;
                      {...inputProps}
                      className=&quot;bg-transparent outline-none p-1&quot;
                  /&gt;
                  &lt;/div&gt;
              )}
              value={getValues(name)}
              onChange={(e, v) =&gt; {
                  setValue(name, v);
              }}
              getOptionLabel={(option) =&gt; option.label || option}
              freeSolo={freeSolo}
          /&gt;
      )
  }
  
  export default Autocomplete;
  </code></pre>
  <p>The options display just fine when I type but when actually selecting an option the input field doesn't actually get updated. It instead shows this error:</p>
  <pre><code>`MUI: The value provided to Autocomplete is invalid.None of the options match with `&quot;&quot;`.You can use the `isOptionEqualToValue` prop to customize the equality test. `
  </code></pre>
  <p>I'm not entirely sure what's going on. Here's a video showing the error in case you need clarification <a href="https://imgur.com/a/xfm1mpb" rel="nofollow noreferrer">https://imgur.com/a/xfm1mpb</a> (sorry for low res, Imgur's compression ruined it)</p>