Skip to content

CheckBox: Remove unsupported labelChildren prop from Storybook controls #1906

@ShubhamS2005

Description

@ShubhamS2005

Description
The CheckBox component no longer supports the labelChildren prop as a direct editable control in Storybook.
Storybook still renders a control for labelChildren, which can cause a runtime React error if an object is set:

Error: Objects are not valid as a React child (found: object with keys {})

Steps to reproduce

Open Storybook for Inputs → CheckBox.
Try to set the labelChildren control to an object ({}).
Observe the runtime error in the console and Storybook crash.

Expected Behavior

No runtime errors in Storybook.
Storybook loads cleanly.
CheckBox continues to render correctly in the app.

Actual Behavior

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

Proposed Solution

Remove the labelChildren control from Storybook via argTypes.
Keep CheckBoxProps unchanged (labelChildren?: ReactNode).
Component functionality remains intact.
Follows the same approach as the is prop PR #1905.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions