Open Blackmorse opened 2 years ago
Did you get it to work, @Blackmorse ?
@ffriande , nope. Since this project looked like non-supported, I decided to use plain javascript module (https://github.com/benjeffery/react-plotlyjs or https://github.com/plotly/react-plotly.js) in my Typescript project
@Blackmorse thanks for the reply. I can't get that solution to work, I still haven't figured out why... How exactly did you add, for example https://github.com/plotly/react-plotly.js to you React Ts app? ps: I am using webpack
@ffriande, I'm not sure that it will work for you, but in my case It was very easy: just followed instruction from this article https://medium.com/@steveruiz/using-a-javascript-library-without-type-declarations-in-a-typescript-project-3643490015f3 (use a Plan C)
To save your time I write down my steps here:
npm install react-plotly.js
desc.d.ts
at the root of your project containing only one line
declare module "react-plotly.js"
tsconfig.json
and add this file to include
array. In my case now it looks like that:
"include": [
"src", "desc.d.ts"
]
react-plotly-ts
and replace them with react-plotly.js
While
npm install
Versions from package.json