title: Flow - How to setState with a value I get from a function?
body: <p>In the <code>getEvaluation</code> function I get the number 1, I want to change the state with this value:</p>
  
  <pre><code>type Props = {
  };
  
  type State = {
      id_evaluation: string,
  };
  
  class Evaluation extends Component &lt; Props, State &gt; {
      state = {
          id_evaluation: '1',
      }
  
      componentDidMount() {
          const id_eval = getEvaluation();
  
          this.setState({
              id_evaluation: id_eval,
          });
  </code></pre>
  
  <p>I checked now 'console.log(typeof(id_eval)), is string.</p>
  
  <p>Flow generates this error:</p>
  
  <blockquote>
    <p>Cannot call <code>this.setState</code> with object literal bound to
    <code>partialState</code> because  null or undefined [1] is incompatible with 
    string [2].</p>
  </blockquote>