-
-
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
sort-comp: static defaultProps
must be placed under componentWillUnmount()
#122
Comments
I'm curious, if you manually add |
I edited "react/sort-comp": [1,
{
"order": [
"constructor",
"lifecycle",
"everything-else",
"render"
]
}], Still, I get this: class AccountInfo extends Component {
static propTypes = {
accountId: PropTypes.string.isRequired
};
//noinspection Eslint
static defaultProps = {
accountId: ''
}; |
And.. I am still getting this error regarding the constuctor placement:
|
ES6 methods are not set in the default So, for now you can set up a custom ...
"react/sort-comp": [1, {
"groups": {
"lifecyle": [
"constructor",
"displayName",
"propTypes",
"contextTypes",
"childContextTypes",
"statics",
"defaultProps",
"getChildContext",
"componentWillMount",
"componentDidMount",
"componentWillReceiveProps",
"shouldComponentUpdate",
"componentWillUpdate",
"componentDidUpdate",
"componentWillUnmount"
]
}
}]
... You can find more informations about this rule configuration settings in the documentation. |
For some reason, the ES6 class composition for React isn't taken into account.
For all obvious reasons, while this is supposed to be the right sort order..
..a warning shows that says:
warning defaultProps must be placed after componentWillUnmount react/sort-comp
The text was updated successfully, but these errors were encountered: