score:3

openModal = (id) = () => {
  this.setState({
    openedDialog: id
  });
}

closeModal = () => {
  this.setState({
    openedDialog: null
  });
}

show={this.state.openedDialog === product.id}
onClick={this.openModal(product.id)}
onClose={this.closeModal}

Related Query

More Query from same tag