-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Support Flow Prop/State syntax #453
Comments
See facebook/react#1833 (comment) - propTypes aren't going anywhere. |
I know, I just linked the thread because someone working on React provided an example of declaring props using Flow. Edit: Apparently the comment you linked to is also written by the same person. |
We already support flow annotations for props (see #382) but not the syntax you described. I do not know Flow very well (I do not use it), but maybe adding support for this will not be very difficult. |
With babel-eslint, it seems to be working fine. |
Should eslint-plugin-react add babel-eslint somehow to people's configs? Seems pretty standard in the React community |
Requiring However, if we want rules that support flow types, it's possible we might need to require that parser. |
This adds support for constructions like this: type Props = {name: string}; class X extends React.Component<void, Props, void> { ... } Which is the preferred way to declare prop types using Flow. The less preferred syntax is still supported: class Z extends React.Component { props: Props; } Fixes jsx-eslint#453
This adds support for constructions like this: type Props = {name: string}; class X extends React.Component<void, Props, void> { ... } Which is the preferred way to declare prop types using Flow. The less preferred syntax is still supported: class Z extends React.Component { props: Props; } Fixes jsx-eslint#453
I believe this was resolved by #1377. |
Is it possible for you to support this:
class MyComponent extends React.Component<void, Props, void> {
which does the same thing as this:
Also described here.
The text was updated successfully, but these errors were encountered: