Skip to content
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

Upgrade React Peer Dependency To Support React v18 #45

Open
extramarksdev opened this issue Jan 27, 2025 · 0 comments
Open

Upgrade React Peer Dependency To Support React v18 #45

extramarksdev opened this issue Jan 27, 2025 · 0 comments

Comments

@extramarksdev
Copy link

Issue: React Version Conflict with @intelllex/react-pdf

We recently migrated our app to React v18, but we encountered a dependency conflict while installing the package @intelllex/react-pdf. The error occurred because the package specifies react@^16.x as a peer dependency, which conflicts with our app's current React version ([email protected]).

Error encountered:

npm error While resolving: [email protected] npm error Found: [email protected] npm error node_modules/react npm error react@"18.3.1" from the root project npm error npm error Could not resolve dependency: npm error peer react@"16.x" from @intelllex/[email protected] npm error node_modules/@intelllex/react-pdf npm error @intelllex/react-pdf@"1.1.1" from the root project npm error

Proposed Solution

To resolve the issue and support both React 16.x and React 18.x versions without conflicts, we propose updating the peerDependencies and devDependencies in the @intelllex/react-pdf package to allow both React 16.x and React 18.x.

1. Update peerDependencies

Update the peerDependencies to support both React 16.x and React 18.x versions. This way, @intelllex/react-pdf will be compatible with both versions of React.

"peerDependencies": { "react": "^16.x || ^18.x", "react-dom": "^16.x || ^18.x" },

2. Update devDependencies

Make sure that the devDependencies are compatible with both React 16.x and React 18.x. The following update will ensure that the package is properly configured for React 18.x while maintaining compatibility with React 16.x.

"devDependencies": { "@babel/plugin-proposal-class-properties": "^7.8.3", "babel-jest": "^26.0.1", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.2", "enzyme-to-json": "^3.4.4", "identity-obj-proxy": "^3.0.0", "jest": "^26.0.1", "nwb": "0.24.x", "nwb-sass": "^0.10.2", "react": "^16.13.1 || ^18.0.0", "react-dom": "^16.13.1 || ^18.0.0" },

Please do let me know, if I should raise a PR for the same and what are the steps to do the same.
Thanks!

@extramarksdev extramarksdev changed the title Upgrade React Peer Dependency To Support v18 Upgrade React Peer Dependency To Support React v18 Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant