I am new to react and am having some trouble passing a simple boolean value as a prop for the MenuItem in the material UI library. I don't think the solution is too complicated. Can someone let me know how I can resolve this error?
The Line that this error is point to is shown below:
<MenuItem value={true}>Yes</MenuItem>
The error looks like this:
The last overload gave the following error.
TS2769: No overload matches this call.
Type 'true' is not assignable to type 'string | number | readonly string[] | undefined'.
402 | onChange={handlePO_status}
403 | >
> 404 | <MenuItem let value={true}>Yes</MenuItem>
| ^^^^^
405 | <MenuItem value={false}>No</MenuItem>
406 | </Select>
407 | </FormControl>
Any help would be greatly appreciated. Thank you!
value="true"
then you can just checkvalue === 'true'
. – Trotter