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

Make React a flexible peer dependency #638

Merged
merged 1 commit into from
May 4, 2022
Merged

Make React a flexible peer dependency #638

merged 1 commit into from
May 4, 2022

Conversation

cowboyd
Copy link
Member

@cowboyd cowboyd commented May 3, 2022

Motivation

React is very finicky about having more than one copy of the react code itself in a single app

https://reactjs.org/warnings/invalid-hook-call-warning.html

Having a hard dependency on React 17 means then that a local copy of React 17 will be installed in this package and that it will be incompatible with React 16 apps.

Approach

This changes the dependency on react to a peer dependency, and furthermore allows it to work on react 16 versions that have hooks, and version 17.

React is very finnicky about having more than one copy of the react
code itself in a single app

https://reactjs.org/warnings/invalid-hook-call-warning.html

Having a hard dependency on React 17 means then that a local copy of
React 17 will be installed in this package and that it will be
incompatible with React 16 apps.

This changes the dependency on react to a peer dependency, and
furthermore allows it to work on react 16 versions that have hooks,
and version 17.
@cowboyd cowboyd requested review from jnicklas and taras May 3, 2022 20:15
Copy link
Member

@taras taras left a comment

Choose a reason for hiding this comment

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

👍

@cowboyd cowboyd merged commit f0e5108 into v2 May 4, 2022
@cowboyd cowboyd deleted the inspect-ui-react-dep branch May 4, 2022 04:07
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