react-markdown
react-markdown copied to clipboard
SlotHTMLAttributes breaks compatibility with React 16 / 17 (missing peerDependency for React 18)
Initial checklist
- [x] I read the support docs
- [x] I read the contributing guide
- [x] I agree to follow the code of conduct
- [x] I searched issues and discussions and couldn’t find anything (or linked relevant results below)
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_
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?
Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.
Hi team! Could you describe why this has been marked as wontfix?
Thanks, — bb
Upgrade to a newer version. If you must use such an old version, enable skipLibCheck.