-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
v1.4.1
What browser are you using?
Chrome
Reproduction repository
https://codesandbox.io/s/wonderful-leaf-t4899?file=/src/App.js
Describe your issue
When trying to use <Menu.Button /> with a custom component it doesn't work as expected and I get the following warning:
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
Simplified example:
const CustomButton = ({ children, onClick }) => (
<button onClick={onClick}>{children}</button>
);
<Menu.Button as={CustomButton}>More</Menu.Button>
Does headless-ui require the <CustomButton/>
-component to forward unknown props down to the html <button>
element am I using it wrong?
Metadata
Metadata
Assignees
Labels
No labels