plotly / react-cytoscapejs

React component for Cytoscape.js network visualisations
MIT License
470 stars 69 forks source link

TS: cannot find module error #108

Open marcasmed opened 1 year ago

marcasmed commented 1 year ago

To those developing with TS and receiving a "module not found" when importing "react-cytoscapejs" (depending on their configuration):

import CytoscapeComponent from 'react-cytoscapejs';  // produces "cannot find module error"

Fix the error by installing the types for React Cytoscape

npm i @types/react-cytoscapejs
import CytoscapeComponent from 'react-cytoscapejs';  // no longer produces error