question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React 18 compatibility tracking issue

See original GitHub issue

Update!

We’ve applied some fixes in #1326, if you are running into React 18 issues please install the insiders build to see if your issues go away:

  • npm install @headlessui/react@insiders
  • yarn add @headlessui/react@insiders.

If you are still running into React 18 related issues, please open a new issue with a reproduction repo attached so that we can tackle those issues as well.


What package within Headless UI are you using?

@headlessui/react

Describe your issue

Now that React 18 is out, it looks like some people are running into issues. This is because of StrictMode in React that does a few extra things to ensure that your library works with Suspense.

Currently it looks like all our components work fine with React 18, except for the Transition component. It just happens that a lot of people use this component in combination with other components like our Menu or Listbox components.

We are aware of the issues and are working on fixes.

In the meantime, if you need React 18 support, then you can temporarily disable StrictMode. If you are using something like Next.js, then you can disable it like this:

const nextConfig = {
  reactStrictMode: false,
  // ...
};

module.exports = nextConfig;

This workaround is a temporary solution so that you can move forward with your work. StrictMode is a development tool anyway and we are working hard to have compatibility with React 18 really soon.

Edited: 5th of April, 2022

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:68
  • Comments:23

github_iconTop GitHub Comments

24reactions
bigintcommented, Mar 31, 2022

It’s breaking again, react 18 is out now please make this issue a high priority one 🙏🏻

24reactions
bmichottecommented, Mar 30, 2022

Now that React 18 is out, I think it’s time to bump this issue 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

React v18.0 – React Blog
In this post, we'll give an overview of what's new in React 18, ... may take some time for libraries to upgrade to...
Read more >
Everything You Should Know About React 18 | Syncfusion Blogs
This blog post explains the significant feature updates of the React 18 version like concurrency, automatic batching, and more with code ...
Read more >
Using strict mode in React 18: A guide to its new behaviors
This release mostly focused on shipping Concurrent Mode, new React hooks, and behavioral changes to React's Strict Mode API. While strict mode ...
Read more >
Upgrade to react 18 — Issues and resolution - Dev Genius
npm install react react-dom. 2. Move to new root API. · npm install react-redux. 5. · npm install react-scripts. If you were using...
Read more >
Simple opacity fade doesn't work in React? - GSAP - GreenSock
This thread now addresses a larger issue between first render animations and React 18's useEffect empty dependency array's new "double" render ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found