Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Details open attribute isn't working for callbacks #142

@nico-bohlinger

Description

@nico-bohlinger

You can set the open attribute for the details component correctly but you can't change it afterwards in a callback. This seems to be a problem with react and I found this solution:

const onToggle = event => {
  event.preventDefault();
  setOpen(!open);
};

// Later on...
return (
  <div className="App">
    <details open={open} onClick={onToggle}>...</details>
  </div>
)

Source: facebook/react#15486

Could somebody fix this?

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