-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Error: A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />. #3316
Comments
I researched and found that this is caused by like: <Disclosure> {/* <= OpenClosedProvider in parent context */}
<Dialog />
</Disclosure>
|
Hey! Can you share a minimal reproduction repo because the code snippet you shared doesn't reproduce it. As @zce mentioned, incorrectly nesting certain components could cause this behavior, if you are putting your |
I tried to do the same after seeing the changes in Edit: After some more testing, there is definitely something wrong when using the |
This happens when I use the Disclosure component to implement a mobile navigation collapse scenario, and this navigation also contains a search dialog. As you said, I can find ways to avoid this, but I don't think it's a very good development experience. I'm not sure if there are other built-in components that use transitionchild, if so, I think they will have similar issues. I'm very sorry, I'm on my phone and can't provide a repro repo at the moment |
@RobinMalfait I will try to create a repro repo tomorrow. In the meantime; I'm checking my code and I am indeed nesting the dialog - I did not think about this before. Here is my code structure: Please note that
I'm using this version of Catalyst - not sure if it's the latest but pretty new:
Parent component:
and then in my Child component:
and then I replaced the
I hope this helps debugging/troubleshooting. |
I figured out a reproduction that seems to reproduce this. So this should be fixed by #3331, and will be available in the next release. If this does not fix your issue after testing, please open a new issue with a minimal reproduction GitHub repo attached. You can already try it using:
|
Thanks @RobinMalfait. Will try the insiders build asap. |
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
What browser are you using?
MacOS Sonoma Version 14.4.1 (23E224)
Safari Version 17.4.1 (19618.1.15.11.14)
Chrome Version 126.0.6478.62 (Official Build) (arm64)
Description:
I tried the new Dialog
transition
APIs but the transitions are not working for me.I tried the code from here: #3307
here: #3309
and here: https://headlessui.com/react/dialog#adding-transitions
This is what I have in my own project:
And it's giving me the following error:
I'm probably just missing something?
The text was updated successfully, but these errors were encountered: