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

Moved react-is to peer dependency #24

Merged
merged 1 commit into from
Feb 6, 2025
Merged

Conversation

imjordanxd
Copy link
Contributor

@imjordanxd imjordanxd commented Jan 30, 2025

Overview

Moving react-is to peerDependencies gives this packages better support for a wider range of React versions. Consumers should ensure the version of react-is install is the same as their version of react. I'm not sure if we can enforce this somehow? This PR is a breaking change but it will resolve the following warning on the repo:

⚠️ As of v4.0.0, this library only supports React 19. If you're using React 18 or under, stay on the (still maintained) v3.2.0+.

I'm not entirely sure if we need to update any logic traversing the tree. I believe the tree structure is consistent between different versions of React.

Comment on lines +54 to +55
"react": "^18.0.0 || ^19.0.0",
"react-is": "^18.0.0 || ^19.0.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support both v18 and v19

@grrowl
Copy link
Owner

grrowl commented Feb 6, 2025

Good solution. In the old world where react-is "just works" a direct dependency made sense.

Noticed recently that the popular library recharts addresses this another way by requiring the consuming app use "overrides" in package.json to match the app's react version. peerDependencies is a lot nicer.

LGTM, will update README and ship a v5

@grrowl grrowl merged commit 220ab03 into grrowl:master Feb 6, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants