FormControlLabel is required with latest alpha release
See original GitHub issueFormControlLabel without label brakes the component with 5.0.0-alpha.33. Prior to this release it was optional.
Cannot read property 'type' of undefined
- [X ] The issue is present in the latest release.
- [ X] I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
When label is not provided FormControlLabel throws error Cannot read property 'type' of undefined
Expected Behavior 🤔
It should render without error
Steps to Reproduce 🕹
Create FormControlLabel without label. https://codesandbox.io/s/mystifying-snow-ksc4t?file=/src/Demo.tsx:232-248
Steps:
Context 🔦
Your Environment 🌎
`npx @material-ui/envinfo`
Don't forget to mention which browser you used.
Output from `npx @material-ui/envinfo` goes here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
FormControlLabel has a default margin-right, is this intended?
Thanks for the report. I agree none of the components should have a margin unless necessary. However, changing this would be a breaking...
Read more >FormControlLabel API - Material UI - MUI
API reference docs for the React FormControlLabel component. Learn about the props, CSS, and other APIs of this exported module.
Read more >@material-ui/core FormControlLabel TypeScript Examples
This page shows TypeScript code examples of @material-ui/core FormControlLabel.
Read more >What is the new Bootstrap 4 control-label class?
You were referring to the alpha docs which are vastly outdated. I mean, the alpha version of Bootstrap 4 is vastly outdated.
Read more >@mui/material - npm
React components that implement Google's Material Design.. Latest version: 5.11.2, last published: 2 days ago. Start using @mui/material in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would vote for making the label required.
My first vote would be to make the
label
required, I don’t see what is the use-case of using aFormControlLabel
without alabel
. If you can share one it would be great!If we don’t want to make this breaking change, this diff should fix the issue and preserve the previous behavior: