title: How can I update this.state with a method?
body: <p>I'm trying to set new values to a state, but I can't do this with the methods, the state stills the same.</p>
  
  <p>here a declare my state</p>
  
  <pre><code> this.state = {
      notes: [],
      selected: null
      };
  }
  </code></pre>
  
  <p>using componentDidMount I can update the state</p>
  
  <pre><code>  componentDidMount() {
  this.setState({
    notes: this.service.notes,
    selected: {
         title: "vazio",
         text: "vazio"
       }
      });
    }
  </code></pre>
  
  <p>but when I use this methods to update, the state stills the same</p>
  
  <pre><code>  onSelect(note) {
     this.setState({
     selected: note
      });
    }
  </code></pre>