material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[docs] FormControl's API page doesn't show `label` as required

Open CWSites opened this issue 3 years ago • 1 comments

The docs do not show label as required, the typing seems fine but there should be a required asterisk next to it on this page https://mui.com/api/form-control-label/#main-content

Originally posted by @CWSites in https://github.com/mui/material-ui/issues/29301#issuecomment-1079403582

CWSites avatar Apr 07 '22 03:04 CWSites

This will likely require a change in the scripts we use to generate the documentation. Currently, we analyze prop types and figure out if a prop is required based on them. We can't, however, change the prop type of label to PropTypes.node.isRequired as it won't allow passing in undefined (which is required, as per #31139). This wouldn't be a problem if we instead relied on type definitions and the existence of ?: vs :.

cc @oliviertassinari, @siriwatknp

michaldudak avatar Apr 08 '22 09:04 michaldudak