Open SherloqueChang opened 2 years ago
If you're using ES modules, you can just do f.e.
import ForceGraph3D from 'react-force-graph-3d';
There's more info about importing this module in the readme.
Yead, it works for 'react-force-graph-3d'. However, here is a specific example: https://github.com/vasturiano/react-force-graph/blob/master/example/text-links/index-3d.html#L28
Since I don't how to deal with<script src="//unpkg.com/three-spritetext"></script>
in a .tsx
file, error 'Cannot find name 'SpriteText'' is reported.
That's for an import from another module: https://github.com/vasturiano/three-spritetext
For the example given in Github,
.js
files are imported in HTML using like:However, if I'd like to import them in a react+typescript project, what should I do?