Invalid react/no-direct-mutation-state in constructor #1382
Closed
Description
In the following special case, the react/no-direct-mutation-state
rule throw an invalid error
class OneComponent extends Component {
constructor() {
super();
class AnotherComponent extends Component {
constructor() {
super();
}
}
this.state = {};
}
}
A better way is to not declare a component into another component constructor but that is an invalid linter error .
Activity