Skip to content

React: Toggle with managed/controlled state issue #4356

@iceleo-com

Description

@iceleo-com

Hi,

I want to control the checked state of the Toggle component, but it seems impossible. If I use the checked attribute instead of defaultChecked, the checked state does not change. I tested both the onChange and onToggleChange events, but the result is still the same.

You can check the sample code here:
https://codesandbox.io/p/sandbox/py2yl6?file=%2Fsrc%2FApp.tsx

Is there any chance this bug can be fixed?

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