-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Typescript @withNamespaces decorator type error #674
Comments
I don't use decorators at all. @nikolay-borzov any thoughts on this one since you helped with the hoc test? |
I'd like to see code that produces that error. I guess we can also add tests for decorator use. I haven't used decorators for a long time. Hm, there is a sentence in docs
But no decorators used in the example |
@dforsl any update on this? |
Sorry, I should of course have included some code from the start. Here's a minimal example:
which gives the following error:
|
Given my very limited experience with typescript, I guess this has to do with that Using the workaround of casting to any ( |
Do you have decorators enabled in your tsconfig? https://www.typescriptlang.org/docs/handbook/decorators.html Since decorators are experimental in nature, I'm not keen to leave this issue open. I'm not against them, just don't have any plans to use/support them personally so it will need to be supported by someone that uses them. If you are interested in pitching in a test and solution (if there is indeed a bug with the types) we are happy to have it. |
Sorry to hijack this thread, but as a related question, are decorators still supported in the latest version with the new |
|
Oh, sorry for missing that part. Thanks! |
Describe the bug
When attempting to use the @withNamespaces-decorator in Typescript, it results in the following error:
... error TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'ComponentClass<Pick<Props, never>, any>' is not assignable to type 'void | typeof ModelList'. Type 'ComponentClass<Pick<Props, never>, any>' is not assignable to type 'typeof ModelList'. Property 'modelStore' is missing in type 'Component<Pick<Props, never>, any, any>' but required in type 'ModelList'.
I'm using other decorators without any issues. Is there something that I could be missing, or is it simply a bug?
Occurs in react-i18next version
9.0.2
The text was updated successfully, but these errors were encountered: