-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Mismatching react version with react 17 #3167
Comments
You can add a property to your root workspace package.json: "resolutions": {
"react": "^17",
"react-dom": "^17"
} This will override the react package resolved for all workspace projects and their respective packages. If you're using react native you may need to add that instead of Dom, or you might not need either. |
@johnrom is this is as easy as just cutting a new release? |
(revised again as I realized Hmm.. yes and no? I don't really know why the user is receiving this issue -- Yarn doesn't pull dev dependencies into the users node modules. I assume the user used
If you used If we want to update peer dependencies (we should), the format is a little different. I messed around with it in one of my old PRs but it isn't any of the ones I currently have open and I couldn't find it. The format is something like this: "peerDependencies": {
"react": ">=17 || >=16.8.0"
} I don't think I ever got yarn workspaces to stop complaining about React when using this technique. I just wrote that out by hand so it might not be exactly that, and I'm not sure it actually works. YMMV. These versions include any React version which supports hooks. Yarn mentions the Union operator in the docs here: https://classic.yarnpkg.com/en/docs/dependency-versions/#toc-unions I tried the following values: {
"react": ">=16.8.0 <18", // between 16.8 and 17.x
"react": "^17 || ^16.8.0", // I like this version better
"react": ">=17 || >=16.8.0", // this version looks weird
} |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 60 days |
Hello. When will the master branch of the formic repo be released? Now, the old react version in version 2.2.6 causes problems with monorepo.
When I check the 2.2.6 package.json it seems used react 16.x version. But we're using react 17.0.1 with yarn workspace. Because of this, it is crashing. I have to use 17 for the formic. I'm seeing the master branch already upgraded.
How can we solve this problem?
The text was updated successfully, but these errors were encountered: