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

React 17 support #52

Open
sc0ttdav3y opened this issue Mar 4, 2021 · 12 comments
Open

React 17 support #52

sc0ttdav3y opened this issue Mar 4, 2021 · 12 comments

Comments

@sc0ttdav3y
Copy link

Hi,

When I try to install this package with react@17.0.1 (latest at time of writing), it fails with a dependency error.

Is there any workaround, or plans to support React 17?

Steps to reproduce

mkdir tempproj
cd tempproj
npm i react@latest
npm i react-outside-click-handler@latest

Error

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!   peer react@"^0.14 || >=15" from react-outside-click-handler@1.3.0
npm ERR!   node_modules/react-outside-click-handler
npm ERR!     react-outside-click-handler@"1.3.0" from the root project
npm ERR!   1 more (react-dom)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^0.14 || ^15.0.0 || ^16.0.0-alpha" from airbnb-prop-types@2.16.0
npm ERR! node_modules/react-outside-click-handler/node_modules/airbnb-prop-types
npm ERR!   airbnb-prop-types@"^2.15.0" from react-outside-click-handler@1.3.0
npm ERR!   node_modules/react-outside-click-handler
npm ERR!     react-outside-click-handler@"1.3.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Context

It looks like this is caused by the dependency on airbnb-prop-types, which currently has an open ticket for React 17 support: ljharb/prop-types-tools#73

@ljharb
Copy link
Collaborator

ljharb commented Mar 4, 2021

Indeed; this is blocked by ljharb/prop-types-tools#73 and enzymejs/enzyme#2430. Once those land, this package will surely add it.

@jannomeister

This comment has been minimized.

@ljharb

This comment has been minimized.

@jorisw
Copy link

jorisw commented Apr 13, 2021

We're using this library without problems with React 17.0.2.

    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-outside-click-handler": "^1.3.0",

@ljharb
Copy link
Collaborator

ljharb commented Apr 13, 2021

@jorisw i expect this library to work fine with new versions of react for the foreseeable future; but if npm ls exits nonzero, your dependency graph is invalid and you can’t rely on anything working.

@moc89
Copy link

moc89 commented Apr 22, 2021

We're using this library without problems with React 17.0.2.

    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-outside-click-handler": "^1.3.0",

I upgraded to 17.0.2 but still same error.

@jokinol
Copy link

jokinol commented Apr 7, 2022

Btw, React 18 is now out and this problem still exists :D

But it is not (directly) this library, it is airbnb-prop-types which is dependency of this project and has "react": "^0.14 || ^15.0.0 || ^16.0.0-alpha" as a peerDependencies.

Both of these projects seems a bit outdated, does anyone know is there any alternative(s) for this library?

@ljharb
Copy link
Collaborator

ljharb commented Apr 7, 2022

Both are blocked on enzyme supporting react 17, and 18. There’s nothing outdated about any of the 3 mentioned projects, except their support of react itself.

@Im-Fran
Copy link

Im-Fran commented Jan 24, 2023

@jokinol, Jordan is right, the problem is because enzyme doesn't have support for react 17 and newer. I've linked an alternative in their PR #74 so it can be used, but until an alternative is implemented we won't be seeing an update soon.

@ljharb
Copy link
Collaborator

ljharb commented Jan 24, 2023

Unfortunately RTL is nowhere close to being an alternative to enzyme.

@patilanz

This comment was marked as spam.

@vammikk

This comment was marked as spam.

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

No branches or pull requests

9 participants