react-vis
react-vis copied to clipboard
Support React 17
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.
Looks like it does not remove these methods after all! Postponed to React 18+.
Ya, so || ^17.0.0
needs to be added to the dependency ( see https://github.com/uber/react-vis/blob/cce5980cd29416bdae592b34f2e52a088176493c/packages/react-vis/package.json#L89 )
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.
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"
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.
@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?
I'm using Yarn, but you can skip peer deps check in NPM with a flag, too.
@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!
@bulyonov Would it be possible for you to address this issue?
Bumping this again, would be extremely useful to support React 17 or 18
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:
https://github.com/uber/react-vis/issues/1485