Skip to content
This repository was archived by the owner on May 29, 2022. It is now read-only.
This repository was archived by the owner on May 29, 2022. It is now read-only.

Dialog component onClose called twice #49

@gutenye

Description

@gutenye

Example from https://react-mdc.github.io/#/dialog

<Dialog open={this.state.open} onClose={onClose}>
  ...
</Dialog>

onClose = () => {
  console.log('close')
   this.setState({open: false})
}

When close a dialog, console outputs two close string. Due to the way it implemented, when user close the dialog, it invoke onClose callback. (first time). The onClose function do setState({open: false} which invoke onClose callback again. (second time)

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