title: Do not mutate state directly, Use setState() react/no-direct-mutation-state in React JS
body: <pre><code>&lt;input
    defaultValue={this.props.str.name}
    ref={(input) =&gt; { this.state.name = input; }}
    name="name"
    type="text"
    className="form-control"
    onChange={this.handleInputChange}
  /&gt; 
  
  handleInputChange(event) {
    this.setState({
      [event.target.name]: event.target.value
    });
  }
  
  if(this.state.name.value === "") {
    this.msg.show('Required fields can not be empty', {
      time: 2000,
      type: 'info',
      icon: &lt;img src="img/avatars/info.png" role="presentation"/&gt;
    });
  }
  </code></pre>
  
  <p>I'm trying to set the default value like that and wanted to access it as well. I did like this and accessed the value with <code>this.state.name.value</code> but the thing is its working but showing the warning as </p>
  
  <blockquote>
    <p>Do not mutate state directly, Use setState() 
    react/no-direct-mutation-state .</p>
  </blockquote>