React Native and React DOM should not be in peerDependencies
#3993
Unanswered
ingvaldlorentzen
asked this question in
General
Replies: 1 comment
-
I agree that this is suboptimal, but from what I can see, we're correctly defining it as an optional peer dependency, and npm shouldn't install it ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I made a comment on the PR related to this, but thought it might be better as it's own discussion.
Since
npm
installs optional dependencies by default, I thinkreact-query
should removereact-native
andreact-dom
from it'speerDependencies
.Obviously this is not optimal, but until this is fixed in
npm
I think it's better than the current situation. There is a discussion on this in thenpm/feedback
repo.Take a "regular" webproject that wants to use
react-query
, by defaultreact-native
will be installed, which is not only unnecessary, it also quickly creates build issues asreact-native
has very different requirements from a webproject.It also limits other dependencies in the project based on the requirements
react-native
has. E.g. using Reactv18.2.0
is not possible in a webproject withreact-query
becasuereact-native
does not supportv18.2.0
Would love to hear other suggestions on how to solve this, both in this project and in projects consuming it.
Beta Was this translation helpful? Give feedback.
All reactions