wufe / react-particles-js

Particles.js for React
https://rpj.bembi.dev/
MIT License
1.16k stars 106 forks source link

TypeScript error, no declaration file for module #3

Closed raptoria closed 7 years ago

raptoria commented 7 years ago

(6,28): error TS7016: Could not find a declaration file for module 'react-particles-js'. '/Users/clacey/caprona-ui/client/node_modules/react-particles-js/lib/particles.js' implicitly has an 'any' type.

wufe commented 7 years ago

The typescript type definition is not available. Try to use this instead:

const ParticlesLibrary = require( 'react-particles-js' );
const Particles = ParticlesLibrary.default;

and use it as usual <Particles />.

wufe commented 7 years ago

With version v1.5.0 a data definition for typescript has been added. You can now use:

import Particles from 'react-particles-js';

Please upgrade react-particles-js to v1.5.0.

raptoria commented 7 years ago

thanks!