I have a React app ("react": "^18.2.0") and I would really like to use this great library. However I found that installing and running it in React is far from easy. I tried installing the latest version of SmilesDrawer (2.1.7) using npm install smiles-drawer, but this resulted in dependency errors related to "react-scripts" and "typescript". I then used npm install smiles-drawer --force which installed version 2.1.7 with warnings.
When I then try to import it into a new .js file (import SmilesDrawer from "smiles-drawer";) I get the following message:
'SmilesDrawer' is declared but its value is never read.ts(6133)
Could not find a declaration file for module 'smiles-drawer'. '/smiles-drawer/app.js' implicitly has an 'any' type.
Try npm i --save-dev @types/smiles-drawer if it exists or add a new declaration (.d.ts) file containing declare module 'smiles-drawer';ts(7016)
It would be great if someone could post a working minimal example along with the dependencies. Although I suspect the solution requires modifications to the library itself.
I have a React app (
"react": "^18.2.0"
) and I would really like to use this great library. However I found that installing and running it in React is far from easy. I tried installing the latest version of SmilesDrawer (2.1.7) usingnpm install smiles-drawer
, but this resulted in dependency errors related to "react-scripts" and "typescript". I then usednpm install smiles-drawer --force
which installed version 2.1.7 with warnings.When I then try to import it into a new .js file (
import SmilesDrawer from "smiles-drawer";
) I get the following message: 'SmilesDrawer' is declared but its value is never read.ts(6133) Could not find a declaration file for module 'smiles-drawer'. '/smiles-drawer/app.js' implicitly has an 'any' type. Trynpm i --save-dev @types/smiles-drawer
if it exists or add a new declaration (.d.ts) file containingdeclare module 'smiles-drawer';
ts(7016)It would be great if someone could post a working minimal example along with the dependencies. Although I suspect the solution requires modifications to the library itself.