Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS]: Add info about unmount in docs for relationship between Transition and child components #2906

Open
spacecat opened this issue Jan 1, 2024 · 0 comments

Comments

@spacecat
Copy link

spacecat commented Jan 1, 2024

Hi, I'm on version "@headlessui/react": "2.0.0-alpha.3" of HeadlessUI.

I have the following component structure:

<Transition>
   <Dialog>
      <Transition.Child>
         <Transition.Child>

If I set unmount={false} on the root <Transition> component do I have to set it on <Dialog>, <Transition.Child> nr 1, <Transition.Child> nr 2, etc components as well?

If I set it on the root <Transition> component only, then my <Dialog> component's state breaks/gets unmounted.

If I set unmount={false} on the root <Transition> component and all child components then my <Dialog> component's state works - this is a bit unintuitive; you should only need to set it on the root <Transition> component IMO like you do with show.

Thanks!

Update: Collected discussion threads where there's some info:

#44 (comment)
#799
#800 (comment)
#1941 (comment)

@spacecat spacecat changed the title [DOCS]: There is basically 0 info about unmount in docs for Dialog and Transition components [DOCS]: Add info about unmount in docs for relationship between Transition and child components Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant