ycs77 / headlessui-float

Easily use Headless UI with Floating UI to position floating elements.
https://headlessui-float.vercel.app
MIT License
349 stars 13 forks source link

[Float] Wrong `children` type #12

Closed JesusTheHun closed 2 years ago

JesusTheHun commented 2 years ago

Use Version Use version when bugs appear:

Describe the bug Currently we have FloatProps.children = ReactElement[]. This means Float cannot have a single child, which is actually perfectly acceptable.

Is there any reason to restrict the children to be a ReactElement ? Can't they just be ReactNode ?

So I suggest to update the type to ReactElement | ReactElement[] or even ReactNode | ReactNode[] if it's possible.

JesusTheHun commented 2 years ago

I poorly read the documentation, sry