Skip to content

Upgrade to React 18

Axel Bocciarelli requested to merge react-18 into towards-react-18

Following !639 and as discussed yesterday with @sfisher, I'm opening this MR to upgrade to React 18 and investigate the consequences together a bit more.

  • From the Daiquiri UI side of things, it's looking great, but I will leave it to you guys to test it thoroughly of course.
  • From the Docusaurus side of things, it's looking decent. Docusaurus has only recently released an alpha version to support React 18. I've upgraded to this alpha version and I'm not seeing any major issue, but of course it remains an alpha version, and there are a bunch of peer deps warnings... so not ideal, but maybe not a blocker.
  • From the tests side of things, it's less great... Contrary to my previous attempts, I decided to not upgrade Jest or any of the Testing Library packages. This, in itself, is far from ideal... However, it does have the merit of limiting the number of failing tests. I've skipped the few that do fail for now:
    • those that test hooks, as the @testing-library/react-hooks has been deprecated and replaced with a renderHook function in @testing-library/react – unfortunately, the API is not exactly the same (missing waitForNextUpdate) and requires upgrading @testing-library/react, which breaks most of the other tests;
    • those that use ReactDOM.render and expect no error to be logged (since React throws an error when this legacy API is used).
Edited by Axel Bocciarelli

Merge request reports