I am using react-hook-form with material UI.On button click I want to get my autocomplete select box value. currently it is taking label as a value I need year should be a value
here is my code
https://codesandbox.io/s/react-hook-form-get-started-nt4kh
when I select { title: "The Godfather", year: 1972 }, the value should be 1972. currently on button click is shows The Godfather why ?
<Autocomplete
options={top100Films}
getOptionLabel={option => option.title}
renderInput={params => (
<TextField
{...params}
inputRef={register}
label={"Resolution Code"}
variant="outlined"
name={"resolutionCode"}
fullWidth
/>
)}

getOptionLabel={option => option.title}here you use option.title as label so it shows "Godfather" in select box. You want to show year instead?valueattribute. See - telerik.com/kendo-react-ui/components/dropdowns/autocomplete/….