Skip to content

React 18 support #280

Description

@Manubi

Hi,
is it possible to get react 18 support for this library? I get a couple TypeScript errors saying:
error TS2786: 'Plot' cannot be used as a JSX component. Its instance type 'Plot' is not a valid JSX element.
Thanks!

 "plotly.js": "^2.12.1",
 "react-plotly.js": "^2.5.1",
 "@types/react-plotly.js": "^2.5.0",

Activity

  1. DanRYoung commented on Jun 14, 2022

    @DanRYoung

    Temporary typing workaround I'm using:

    {/* @ts-ignore */}
    <PlotlyPlot />
  2. sterlingwalsh commented on Jun 21, 2022

    @sterlingwalsh

    Had some issues with react 18 as well as specifically react-scripts 5 because of dependency changes in webpack5 . The following is working.

    "plotly.js-dist-min": "^2.12.1",
    "react-plotly.js": "^2.5.1",
    "@types/react-plotly.js": "^2.5.1",
    
    import Plot from 'react-plotly.js';
    import Plotly, { PlotData } from 'plotly.js-dist-min'; 
    
  3. kws1207 commented on Aug 27, 2024

    @kws1207

    Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions