Skip to content
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

Creating a global object using hookstate, but unable to find the property when using it. #394

Open
1437496027 opened this issue Jun 28, 2023 · 2 comments

Comments

@1437496027
Copy link

1437496027 commented Jun 28, 2023

image

image

@avkonst
Copy link
Owner

avkonst commented Jun 28, 2023

please try restarting your TS server. If it does not help, I need a reproducer

@1437496027
Copy link
Author

please try restarting your TS server. If it does not help, I need a reproducer

It's just that there is no type hinting in TS, but it doesn't affect the usage.

I want to achieve the effect of TypeScript type hinting. I tried it, and if I add type checking for basic types like number and boolean, it works fine. However, when the type is an object or 'any', it prompts that the property does not exist on type 'State<IData, {}>'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants