Closed
Description
Hello,
If I am correct, using no-did-mount-set-state should trigger with the following code:
import React from 'react'
class Test extends React.Component {
state = {}
componentDidMount = () => {
this.setState({
name: this.props.name.toUpperCase()
})
}
render() {
return <div>Hello {this.state.name}</div>
}
}
export default Test
For some reason, I do not get any errors from ESLint. The actual rule I am using is 'react/no-did-mount-set-state': [2, 'disallow-in-func']
.
Question
Should the rule trigger with the code above?
System setup
Windows 10, node v.8.9.3, eslint-plugin-react v. 7.5.1, ESLint v.3.19.0 & babel-eslint 8.0.3.