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

Support React 17 #1356

Open
Xiot opened this issue Jun 15, 2020 · 11 comments
Open

Support React 17 #1356

Xiot opened this issue Jun 15, 2020 · 11 comments

Comments

@Xiot
Copy link
Contributor

Xiot commented Jun 15, 2020

React 17 adds support for async rendering which will need some testing and tweaking to properly support.

It explicitly removes support for various lifecycle methods on class components:

componentWillReceiveProps
componentWillMount
componentWillUpdate

and moves to use the new ones

getDerivedStateFromProps
getSnapshotBeforeUpdate

These new methods, and the deprecation warnings were added back in 16.3.

Do do have a couple places that I believe are still using the old methods, although there was a pass to remove them.

@wojtekmaj
Copy link

Looks like it does not remove these methods after all! Postponed to React 18+.

@daveisfera
Copy link

Ya, so || ^17.0.0 needs to be added to the dependency ( see

"react": "^16.8.3",
)

@karamvirsingh98
Copy link

Hi, I can't seem to install react-vis in a create-react-app project with React 17. Here's the npm error log, hope that helps!

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"15.3.0 - 16.x" from [email protected]
npm ERR! node_modules/react-vis
npm ERR! react-vis@"*" 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.

@bmaupin
Copy link

bmaupin commented Jan 5, 2022

Now that npm has overrides, I wonder if that could be used as a workaround in this case since this library is unmaintained?

https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides

e.g.

  "overrides": {
    "react": "^17.0.0"

@wojtekmaj
Copy link

Yes it could. I'm happily using react-vis with React 17 in production on a large scale commercial application with zero complaints. Hell, preparing to upgrade to React 18 as soon as it gets released, with RC being evaluated right now, and everything still works just fine.

@bmaupin
Copy link

bmaupin commented Jan 5, 2022

@wojtekmaj Since npm overrides were just added, how are you using react-vis with React 17? Seems like I wasn't even able to upgrade React with react-vis as a dependency. Are you using a different package manager?

@wojtekmaj
Copy link

I'm using Yarn, but you can skip peer deps check in NPM with a flag, too.

@bmaupin
Copy link

bmaupin commented Jan 6, 2022

@wojtekmaj Ah ok. I think the new npm overrides feature is probably better for something like this since it can be configured in package.json without having to use any special flags every time (which I would probably forget). But it's always good to have options. Thanks!

@tp00012x
Copy link

@bulyonov Would it be possible for you to address this issue?

@ndrewtl
Copy link

ndrewtl commented Jul 10, 2023

Bumping this again, would be extremely useful to support React 17 or 18

@jkytomak
Copy link

jkytomak commented Nov 14, 2023

We have been using React 17 for a while with react-vis without any problems, but updating to React 18 throws plenty of typesript errors.
So I created separate issue for 18:
#1485

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

8 participants