For anybody who uses MUI 6+, InputProps is set as deprecated, and it should be replaced with slotProps with input property assigned an object with startAdornment and endAdornment as properties.
To fix this, replace the following snippet:
InputProps={{
startAdornment: (
<InputAdornment position="start">
<SearchIcon />
</InputAdornment>
),
endAdornment: value && (
<IconButton
aria-label="toggle password visibility"
onClick={() => setValue("")}
><CancelRoundedIcon/></IconButton>
)
}}
With the following:
slotProps={{
input: {
startAdornment: (
<InputAdornment position="start">
<SearchIcon />
</InputAdornment>
),
endAdornment: value && (
<IconButton
aria-label="toggle password visibility"
onClick={() => setValue("")}
><CancelRoundedIcon/></IconButton>
)
},
}}
For more info, please refer to this guide