-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Suggestion: Allow named functions to use predefined types #19106
Comments
You can do this: function NamedComponent() {
}
namespace NamedComponent {
export const propTypes = {};
} Unfortunately, we won't do any excess property checking in this case. Although if you could write |
Duplicate of #15868 |
More accurately this is a duplicate of #16918 |
Thanks guys! I searched for previous issues but apparently my skills failed me 😅 . I think @Kovensky is right, #16918 is what I'm looking for. |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
Currently there is no way to use a predefined type with a named function in typescript. I find this regularly causes issues with functional stateless components in React.
I'm propose a method to type traditionally named functions.
Grammar Options
Option 1
Option 2
The text was updated successfully, but these errors were encountered: