-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
The problem
The current package.json for @emotion/react and @emotion/styled is as follows:
"peerDependencies": {
"react": ">=16.8.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
This code is ultimately equivalent to the following code.
"peerDependencies": {
"react": ">=16.8.0",
"@types/react": "*"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},

Upon verification, I learned that the addition of peerDependenciesMeta was due to errors occurring in v10.
If using Meta, I believe it would be even better to explicitly align the version of react within peerDependencies. This is why I decided to write this message. Since you've already set React to be >=16.8.0, specifying @types/react >= 16.8.0 seems safer and more suitable for common practices than using @types/react "*" indiscriminately.
Proposed solution
Explicitly adding
@emotion/react
"peerDependencies": {
"react": ">=16.8.0",
"@types/react": ">=16.8.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
@emotion/styled
"peerDependencies": {
"@emotion/react": "^11.0.0-rc.0",
"react": ">=16.8.0",
"@types/react": ">=16.8.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
Alternative solutions
Additional context