New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No Typescript types for react-tsparticles #922
Comments
Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details. |
I don't understand what you are expecting to be exported, the default export is one and it's easier to have the The If you can explain further the issue I can evaluate it better. |
The I don’t really understand what is the problem export interface IParticlesProps {
id?: string;
width?: string;
height?: string;
options?: ISourceOptions;
params?: ISourceOptions;
style?: CSSProperties;
className?: string;
canvasClassName?: string;
container?: RefObject<Container>;
} These are the properties exported from 1.18 (1.17 has less optional and a more complex options type). Can you try using 1.18 (beta for now) and tell me it the issue persist? |
I saw you merged 1.18 so I just upgraded to that and the problem persists. I created a codesandbox so you can see it in action: https://codesandbox.io/s/nifty-tesla-06sg1?file=/pages/index.js |
Thanks! I've understood and found the issue. It will be solved in 1.18.1 that will be released later today. |
@matteobruni Great, thanks alot for that :) |
|
@matteobruni the issue persists in |
I tried autocompleting on CodeSandbox but it doesn't work fine even in simple HTML tags like WebStorm instead had a good autocompletion in |
the reason for that was because https://codesandbox.io/s/nifty-tesla-06sg1?file=/pages/index.tsx |
I've done more tests with VSCode, the demo project inside this repository was working fine, but I've found some tricks to make it work for other projects by adding some JSDoc comments. I'll release it later today with the fix, this should be the definitive solution (at least I hope it is) |
When importing the particle component as described in the docs:
I don't get any types for the props of the component. I can however import like the following:
and then use those types for the options, but it's not ideal.
Typescript Version: 4.0.3
react-tsparticles Version: 1.17.22
The text was updated successfully, but these errors were encountered: