-
Notifications
You must be signed in to change notification settings - Fork 7
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
Don't pin the react and react-dom version and move react to peerDependencies #8
Comments
If r170 version of three.js is causing problem, maybe only three.js should be pinned? Even though this may still cause warnings that multiple three.js instances gets loaded. |
I think it is also necessary to move |
@felixtrz 's previously decided to pin a specific version of |
Compatible versions can be detected even if set to peer dependencies. like this: {
"peerDependencies": {
"react": ">=18.0",
"react-dom": ">=18.0",
"three": "<=0.168"
}
} |
We should always use the caret (^) symbol to specify the react version range in the package.json in a public library and let package manager to resolve to a single instance of react package.
The react and react-dom should be in the peerDependencies, because our project (we as a user) will install them. The duplicate instances of the package also increase the project size.
If we go to your npm package https://www.npmjs.com/package/@iwer/devui?activeTab=code and look for the build/iwer-devui.min.js you can find duplicate code of the react package.
Also duplication will cause hard to debug bugs in production as the context and hook used by one version of react is returning something, and the context and hook used by another version of react is returning a different thing.
See facebook/react#13991
The text was updated successfully, but these errors were encountered: