Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peer dependency error when upgrading react and react-dom to react 19 (Nextjs 15) #3538

Closed
franckadil opened this issue Oct 22, 2024 · 2 comments
Assignees

Comments

@franckadil
Copy link

What package within Headless UI are you using?

What version of that package are you using?

@headlessui/react: "^2.1.10"

Describe your issue

Upgrading to next.js 15 with the minimum version of react and react-dom that is now 19 I get a peer dependency error that breaks the upgrade. headlessui requires react 18.

@stpierrel
Copy link

I couldn't wait, so I went ahead and refactored all the components I had access to. As we know, element.ref access has been removed in React 19, and refs should now be treated as regular props. The stack trace points specifically to some @headlessui/react components, and while I've tackled most of them, there are still two left to refactor regarding this if not mistaking:

  • node_modules/@headlessui/react/dist/utils/render.js
  • node_modules/@headlessui/react/dist/components/button/button.js

@reinink reinink self-assigned this Oct 25, 2024
@reinink
Copy link
Member

reinink commented Oct 25, 2024

Hey folks! We added React 19 support to Headless UI today (see #3543). You can upgrade to this version by running:

npm install @headlessui/react@latest

Please let us know if you run into any issues! 🙏

@reinink reinink closed this as completed Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants