Giter VIP home page Giter VIP logo

Comments (5)

ycs77 avatar ycs77 commented on August 23, 2024

The as property is a wrapper around the floating element of Float, usually using a div, span or Fragment (is no wrapper) to wrap around the floating element.

This bug is currently I won't to resolve unless you have a real use case for using this. 😅

from headlessui-float.

JesusTheHun avatar JesusTheHun commented on August 23, 2024

I have a real use case for it : I need to apply classes to the Float wrapper.

If you don't want to support those components then you should change the property type since its not React.ElementType.

from headlessui-float.

JesusTheHun avatar JesusTheHun commented on August 23, 2024

Side note : don't close people's issue before hearing their point, it's perceived as really rude.

from headlessui-float.

ycs77 avatar ycs77 commented on August 23, 2024

This not a bug, must use forwardRef instead FunctionComponent.

Original:

const DummyDiv: React.FC<React.PropsWithChildren> = ({ children, ...restProps }) => {
  return <div {...restProps}>{children}</div>
}

Change to:

const DummyDiv = React.forwardRef<any, { children: any, style: any }>(({ children, ...otherProps }, ref) => {
  return <div {...otherProps} ref={ref}>{children}</div>
})

Then work.

from headlessui-float.

JesusTheHun avatar JesusTheHun commented on August 23, 2024

Alright thanks ! A quick mention in the documentation would be great :)

from headlessui-float.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.