Skip to content

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

@hbendev

Description

@hbendev

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

Metadata

Metadata

Labels

bugSomething isn't workingdependenciesPull requests that update a dependency file

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions