This was a simple fix, but something that I had a lot of due to making a baseline template with most of the life cycle functions defined as empty functions. I had a template that was roughly:
class myComponent extends React.Component{
constructor(props){
super(props)
}componentWillMount(){
}componentDidMount(){
}componentWillReceiveProps(){
}componentWillUpdate(){
}componentDidUpdate(){
}componentWillUnmount(){
}render(){
<div>display stuff</div>
}
}
The fix was to remove the constructor() method. I also removed all the empty functions, leaving me with:
class myComponent extends React.Component{
render(){
<div>display stuff</div>
}
}
In some cases, this led to ES Lint suggesting that I convert to a Stateless Function, instead of a component.