tailwindlabs / headlessui

Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.

Home Page:https://headlessui.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Transition - current component <Transition.Child /> is rendering a "Fragment".

mbhartley-za opened this issue · comments

Good day.
I did a clean setup of a React app and installed the latest version.
When I use Transition, it gives this error message below, if I then take the transition out, page works fine again.

image

My code.
image

Hey!

This happens when the child of Transition doesn't accept a ref and therefore we can't forward the ref to the underlying DOM node. This is necessary to animate the DOM node directly by applying the correct classes at the correct moment in time.

This seems to be an issue with riIcons.RiCloseCircleLine because I'm pretty sure it doesn't forward the ref correctly.

If you inline the <svg /> directly, then it should work as expected.

An alternative solution is to wrap the icon with a <div> such that you transition the div. This should work as expected because you are only transitioning the opacity-*

Hope this helps!