Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CWSites opened this issue Apr 7, 2022 · 1 comment
Open

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

CWSites opened this issue Apr 7, 2022 · 1 comment
Assignees
Labels
component: FormControl The React component docs Improvements or additions to the documentation

Comments

@CWSites
Copy link

CWSites commented Apr 7, 2022

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 #29301 (comment)

@danilo-leal danilo-leal changed the title 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 [docs] FormContro; 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 Apr 7, 2022
@danilo-leal danilo-leal changed the title [docs] FormContro; 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 [docs] FormControl's API page doesn't show label as required Apr 7, 2022
@danilo-leal danilo-leal added component: FormControl The React component docs Improvements or additions to the documentation labels Apr 7, 2022
@michaldudak
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: FormControl The React component docs Improvements or additions to the documentation
Projects
None yet
Development

No branches or pull requests

3 participants