react-vis icon indicating copy to clipboard operation
react-vis copied to clipboard

React 18 support

Open jkytomak opened this issue 9 months ago • 3 comments

When trying to update to React 18 I get this kind of errors of all react-vis components:

error TS2786: 'FlexibleWidthXYPlot' cannot be used as a JSX component.
  Its type 'typeof FlexibleWidthXYPlot' is not a valid JSX element type.

Looks like these errors come also with "@types/react": "17.0.67" or newer. React-vis with React 17 works with fine with "@types/react": "17.0.66" or older.

jkytomak avatar Nov 14 '23 11:11 jkytomak

I'm not even able to install react-vis in a fresh React 18 project.

collink avatar Jan 17 '24 06:01 collink

@collink Are you encountering an error indicating a peer dependency version conflict? The package react-vis requires a React version from 15.0.0 to 16.x, which is incompatible with the React version 18.0.0 installed in your project.

image

To work around this, try running the command npm install [email protected] --legacy-peer-deps. The --legacy-peer-deps flag allows you to bypass peer dependency conflicts.

image

I suggest using [email protected] since the latest version has some issues with component rendering (#1482). I'll investigate this further. Meanwhile, this should help!

thisis-Shitanshu avatar Jan 28 '24 17:01 thisis-Shitanshu

I have the same issue with RadialChart 'RadialChart' cannot be used as a JSX component. even with version 1.11.12 installed with yarn. Then sad but practically I have to find another alternative that at least works

dancespiele avatar Mar 26 '24 11:03 dancespiele