-
Notifications
You must be signed in to change notification settings - Fork 0
Labels
phase / ready-to-goThis issue merged and will be included in the current milestone releaseThis issue merged and will be included in the current milestone releasetype / bugSomething isn't workingSomething isn't working
Milestone
Description
Component
Checkbox
Is this a regression?
None
Describe the bug
The Checkbox component currently enforces the name prop as a required property. While the name attribute is necessary for form submission and accessibility when the component is part of a native HTML <form>, it is not required when the Checkbox is used for state management within a controlled React environment or for display purposes outside of a form context.
To Reproduce
- Render a standalone
Checkboxcomponent in aReactapplication without passing thenameprop
<Checkbox checked={isChecked} onChange={handleChange} /> - The component throws a runtime
erroror aPropTypes/TypeScript errorindicating that the requirednameprop is missing.
Expected behavior
The name prop should be changed from required to optional in the component's interface.
Screenshots
No response
Package version
v3.0.0
Desktop
. OS:
. Browser & version:
. Additional Information:
Smartphone
. Device:
. OS:
. Browser & version:
. Additional Information:
Exception or Error
Additional context
No response
Metadata
Metadata
Assignees
Labels
phase / ready-to-goThis issue merged and will be included in the current milestone releaseThis issue merged and will be included in the current milestone releasetype / bugSomething isn't workingSomething isn't working