cahilfoley/react-snowfall

Issue with types

Closed this issue · 4 comments

Failed to compile.

./node_modules/react-snowfall/lib/Snowflake.d.ts:10:27
Type error: ',' expected.

8 | * The default value is [0.5, 3.0].
9 | */

10 | radius: [minimumRadius: number, maximumRadius: number];
| ^
11 | /**
12 | * The minimum and maximum speed of the snowflake.

Hi @eugeneshulga869, which version of TypeScript are you using?

The definition provided with the package uses Labeled Tuple Elements to make things more readable. If you're a version of TypeScript <4 this could explain the issue.

I think I got a similar problem. I included the package in my react app and then the types were not resolved correctly:

ERROR in node_modules/my-app/index.d.ts:1764:14 - error TS1110: Type expected.
1764     radius: [, ];

ERROR in node_modules/my-app/index.d.ts:1775:13 - error TS1110: Type expected.
1775     speed: [, ];

ERROR in node_modules/my-app/index.d.ts:1786:12 - error TS1110: Type expected.
1786     wind: [, ];

Using Typescript 4.3.5

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Thanks @daniel-rck for the additional info. I've just published a new version v1.1.2 that should resolve this. Please let me know if you're still having a problem!