Skip to content

Requires two clicks to turn from true to false. #21

@alexbowers

Description

@alexbowers

When using this toggle state, it takes 2 presses to turn from active to inactive the first time, if the value is initialised as active.

<Switch
                                    
                                    value={true}
                                    onChangeValue={(value) => {
                                      console.log(value);
                                      this.setState({ marginValue: !marginValue});
                                     
                                    }}
                                />

I can see it starts in the active manner because of value={true}, but when clicking it the first time, the value from the onChangeValue is also `true. After that, the value represents what I expect it to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions