Support static class getter propTypes
See original GitHub issueWith classes you can also define your propTypes on a static getter property, which this plugin doesn’t seem to be able to remove currently.
Example:
class MyComponent extends React.Component {
    static get propTypes() {
        return {
            children: PropTypes.node.isRequired
        };
    }
    render() {
        return this.props.children;
    }
}
Issue Analytics
- State:
 - Created 6 years ago
 - Reactions:13
 - Comments:6 (1 by maintainers)
 
Top Results From Across the Web
Support propTypes defined using static getter : WEB-32279
WebStorm doesn't provide code completion for props when they are defined using static getter. class App extends Component { static get propTypes() {...
Read more >Is it OK to put propTypes and defaultProps as static props ...
Oh yes, it's totaly legit with Babel (or other transpilers) ... ...as it gets transpiled to this anyway. class DataLoader extends React.Component {}...
Read more >Bountysource
Support static class getter propTypes. ... Contact Us. support@bountysource.zendesk.com · @bountysource on Twitter; Bountysource on Facebook ...
Read more >Typechecking With PropTypes - React
Since ES2022 you can also declare defaultProps as static property within a React component class. For more information, see the class public static...
Read more >How to use the prop-types.instanceOf function in prop ... - Snyk
To help you get started, we've selected a few prop-types. ... class FilteringCounterBadge extends BaseLabel { static propTypes = { alertStore: PropTypes.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Would like this too, just adding another syntax that is almost similar for completeness:
Is there any progress on this? I am using this babel plugin but, I still have propTypes that are static fields in my components being transpiled into webpack bundle.