wufe / react-particles-js

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

Failed to compile, TypeScript error #142

Closed demiters closed 4 years ago

demiters commented 4 years ago

Tried to use this as per docs in a TS project with create-react-app but got:



/home/***/node_modules/tsparticles/dist/Core/Canvas.d.ts
TypeScript error in /home/***/node_modules/tsparticles/dist/Core/Canvas.d.ts(1,13):
'=' expected.  TS1005

  > 1 | import type { Container } from "./Container";
      |             ^
    2 | import type { IDimension } from "./Interfaces/IDimension";
    3 | import type { IRgb } from "./Interfaces/IRgb";
    4 | import type { ICoordinates } from "./Interfaces/ICoordinates";```
matteobruni commented 4 years ago

Hi @demiters,

Which version of TypeScript are you using? TypeScript 3.8 is the minimum version required

demiters commented 4 years ago

CRA provides TS 3.7.2. Upgrading fixed this! Thanks.