Looking for help on binding the as
prop throughout the HeadlessUI package.
The prop can take an element or it can take a string. I am unsure what this type would be, I have tried the following:
module Child = {
@module("@headlessui/react") @react.component @scope("Transition")
external make: (
~enter: string=?,
~enterFrom: string=?,
~enterTo: string=?,
~leave: string=?,
~leaveFrom: string=?,
~leaveTo: string=?,
~as_: 'as_=?,
~children: 'children,
) => React.element = "Child"
}
<HeadlessUI2.Transition.Child
as_={React.Fragment} <-- ERROR
enter=%tw("ease-out duration-300")
enterFrom=%tw("opacity-0")
enterTo=%tw("opacity-100")
leave=%tw("ease-in duration-200")
leaveFrom=%tw("opacity-100")
leaveTo=%tw("opacity-0")>
<HeadlessUI2.Dialog.Overlay
className=%tw("fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity")
/>
</HeadlessUI2.Transition.Child>
Thanks!