react-markdown icon indicating copy to clipboard operation
react-markdown copied to clipboard

SlotHTMLAttributes breaks compatibility with React 16 / 17 (missing peerDependency for React 18)

Open RadekJakGit opened this issue 8 months ago • 1 comments

Initial checklist

Affected package

6.0.0

Steps to reproduce

Version 6.0.0 requires react 18.

Actual behavior

In [email protected], the TypeScript definitions use React.SlotHTMLAttributes, which is only available in @types/[email protected]+. This causes compilation errors in projects using React 16 or 17, such as: error TS2724: 'React' has no exported member named 'SlotHTMLAttributes'.

This makes it impossible to use this package with React 16 or 17 without type errors, even though the package technically installs fine due to missing peer dependency checks.

Expected behavior

To improve developer experience and avoid silent breakage, please consider adding:

"peerDependencies": {
  "react": "^18.0.0",
  "react-dom": "^18.0.0"
}


### Runtime

_No response_

### Package manager

_No response_

### Operating system

_No response_

### Build and bundle tools

_No response_

RadekJakGit avatar Apr 11 '25 17:04 RadekJakGit

react-markdown@7 was released in 2021. This was 4 years ago. We’re already at 10 now. A lot has improved, also in React and TypeScript. Why are you using such old versions?

remcohaszing avatar Apr 11 '25 20:04 remcohaszing

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

github-actions[bot] avatar Nov 27 '25 07:11 github-actions[bot]

Hi team! Could you describe why this has been marked as wontfix?

Thanks, — bb

github-actions[bot] avatar Nov 27 '25 07:11 github-actions[bot]

Upgrade to a newer version. If you must use such an old version, enable skipLibCheck.

remcohaszing avatar Nov 27 '25 07:11 remcohaszing