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
Using Tabs will break with React 18 and Docusaurus v2.3 #8592
Comments
Thanks for the report. This is due to the use of |
Not sure to understand why you want to use React 18 here @anaclumos , we don't officially support it so do we really want to qualify this as a bug? Similarly, if you decide to use Docusaurus 2.3 with React 0.13, things will break 🤷♂️ Technically there's probably a way to make it work under React 18 but is it really worth it to invest time in solving this? We could as well make any Docusaurus site on React !== 17 fail fast and print a good error message that we do not support React 18? It's not because it "seems to work" that it actually do, there might be subtle hydration bugs triggered by using React 18, for which we don't want to spend time on support. Our peer deps do not include React 18 atm. Are we even sure that sites using React 18 aren't running duplicate non-hoisted React copies? "peerDependencies": {
"react": "^16.8.4 || ^17.0.0",
"react-dom": "^16.8.4 || ^17.0.0"
}, Edit: apparently yarn will not report any error but npm will do:
|
Fix was easy so we'll merge/release it, but I don't particularly recommend React 18 for now. Other similar things might break and we don't even build our own site under React 18 with our CI so we are less likely to notice when things break. PR: #8618 |
please test the canary release and let me know if this doesn't work. On a newly initialized site it works 👍 |
Hey @slorber ; I just had the same issue and I was coming here to create it :-) Thanks for resolving it already I honestly didn't pay attention to react version support, I have it in my monorepo more than year now I didn't have problems. The reason for me to use react 18 is that it I use it practically everywhere I use React. Especially in the monorepo of my library. I think I can downgrade react specifically for the docs package (I didn't know about this), but I think waiting for the patch is worth it. Please let us know when it may get released ? Thanks again. |
Re: why many use React v18, it's because of the nice hooks like |
Just an FYI, I use React 18 for useId() and https://github.com/shuding/react-wrap-balancer |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
It will break when using Docusaurus v2.3 and React 18 with Tabs, when
yarn build
ing.Reproducible demo
https://codesandbox.io/s/hungry-hodgkin-2z1jdc
Steps to reproduce
yarn add react@18 react-dom@18
yarn dev
works.yarn build
fails.Expected behavior
The build should not fail.
Actual behavior
The build fails.
Your environment
Self-service
The text was updated successfully, but these errors were encountered: