With the project set up using create-react-app
and custom-react-scripts
to utilize decorators for MobX
, I am aiming to incorporate the react-c3js
library for data visualization. Surprisingly, everything is functioning correctly, but there's a warning popping up in my IDE (VSCode) when attempting to import from react-c3js
:
[ts] Could not find a declaration file for module 'react-c3js'. '/Users/banana/code/d3/d3-gdp/node_modules/react-c3js/react-c3js.js' implicitly has an 'any' type. Try
npm install @types/react-c3js
if it exists or add a new declaration (.d.ts) file containingdeclare module 'react-c3js';
module "/Users/banana/code/d3/d3-gdp/node_modules/react-c3js/react-c3js"
Since this project doesn't involve typescript, I'm puzzled by the appearance of this error message.
Provided below is the content of my package.json
:
{
"name": "d3-gdp",
"version": "0.1.0",
"private": true,
"dependencies": {
"custom-react-scripts": "0.2.2",
"d3": "^5.7.0",
"mobx": "^5.5.0",
"mobx-react": "^5.2.8",
"npm": "^6.4.1",
"react": "^16.5.2",
"react-c3js": "^0.1.20",
"react-dom": "^16.5.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"webpack-dashboard": "^2.0.0"
}
}
This is where I import react-c3js and implement the example provided in their documentation. The line that triggers the IDE warning is indicated with a comment:
// src/index.js
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import registerServiceWorker from "./registerServiceWorker";
import C3Chart from "react-c3js"; // ISSUE OCCURS HERE
import "c3/c3.css";
const data = {
columns: [
["data1", 30, 200, 100, 400, 150, 250],
["data2", 50, 20, 10, 40, 15, 25]
]
};
ReactDOM.render(<C3Chart data={data} />, document.getElementById("root"));
registerServiceWorker();
Is the warning related to the react-c3js
module or is it specific to my project setup? Should I be concerned about it or can I ignore it as long as things are running smoothly? I aim to comprehend the reason behind this warning and its significance. Appreciate any insights shared!