Skip to content

fix(checkbox): remove unsupported labelChildren prop from Storybook (ref #1905)#1907

Open
ShubhamS2005 wants to merge 1 commit intoRocketChat:mainfrom
ShubhamS2005:fix/checkbox-labelChildren
Open

fix(checkbox): remove unsupported labelChildren prop from Storybook (ref #1905)#1907
ShubhamS2005 wants to merge 1 commit intoRocketChat:mainfrom
ShubhamS2005:fix/checkbox-labelChildren

Conversation

@ShubhamS2005
Copy link
Copy Markdown

Proposed changes

Removed the labelChildren control from Storybook to prevent runtime React errors.
Updated CheckBox.stories.tsx to disable labelChildren in argTypes:

argTypes: {
  labelChildren: { table: { disable: true } },
}

Component functionality remains unchanged.
Prevents crashes when someone sets labelChildren to an object ({}) in Storybook.
Approach mirrors the is prop fix in PR #1905.

Issue(s)

Related to the runtime crash issue in Storybook for labelChildren.
See discussion in issue: “CheckBox: Storybook crashes when using labelChildren control”
Reference PR for previous similar fix: #1905

Steps to Reproduce

Open Storybook → Inputs → CheckBox.
Attempt to set the labelChildren control to an object ({}).
Observe the runtime React error:
Objects are not valid as a React child (found: object with keys {})

Expected Behavior

No runtime errors in Storybook.
Storybook loads cleanly.
CheckBox renders correctly in the app.

Actual Behavior

Storybook crashes when labelChildren is set to an object.
Component works fine outside Storybook.

Further comments

Only Storybook controls are affected; the component itself remains fully functional.
Tested manually in Storybook for Default, Checked, Indeterminate, Disabled, and DefaultChecked stories.
Backward-compatible.
Closes #1906

Commit diff for reference

diff --git a/packages/fuselage/src/components/CheckBox/CheckBox.stories.tsx b/packages/fuselage/src/components/CheckBox/CheckBox.stories.tsx
index abcdef1..1234567 100644
--- a/packages/fuselage/src/components/CheckBox/CheckBox.stories.tsx
+++ b/packages/fuselage/src/components/CheckBox/CheckBox.stories.tsx
@@
 export default {
   title: 'Inputs/CheckBox',
   component: CheckBox,
+  argTypes: {
+    // Disable the control for labelChildren to prevent runtime React errors
+    labelChildren: { table: { disable: true } },
+  },
 } satisfies Meta<typeof CheckBox>;

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 21, 2026

⚠️ No Changeset found

Latest commit: 346bb8f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CheckBox: Remove unsupported labelChildren prop from Storybook controls

1 participant