remarkablemark/html-react-parser

Match react and @types/react versions in peer dependency list

hbendev opened this issue · 1 comments

Expected Behavior

Versions of peer dependencies should match between react and @types/react.

Actual Behavior

"@types/react": "17 || 18",
"react": "0.14 || 15 || 16 || 17 || 18"

Steps to Reproduce

npm i html-react-parser@5.1.10 on a package with react@16 and @types/react@16

npm error Could not resolve dependency:
npm error peerOptional @types/react@"17 || 18" from html-react-parser@5.1.10
npm error node_modules/html-react-parser
npm error   html-react-parser@"5.1.10" from the root project
npm error
npm error Conflicting peer dependency: @types/react@18.3.3
npm error node_modules/@types/react
npm error   peerOptional @types/react@"17 || 18" from html-react-parser@5.1.10
npm error   node_modules/html-react-parser
npm error     html-react-parser@"5.1.10" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

Reproducible Demo

Environment

  • Version:
  • Platform:
  • Browser:
  • OS:

Keywords

@hbendev would you like to open a PR? I believe the fix would be to update this line:

-    "@types/react": "17 || 18",
+    "@types/react": "0.14 || 15 || 16 || 17 || 18",