title: React setState only if thing exists?
body: <p>So I am setting up a parent with several state attributes to pass to children. This is being done via AJAX. The trouble is that for some of these variables, the response may return <code>null</code> or <code>undefined</code>.</p>
  
  <pre><code>$.post(this.props.source, function(data) {
  
    // Parse the response
    var response = JSON.parse(data);
  
    if (this.isMounted()) {
      this.setState({
  
        // Set initial state vars
        minPrice:         response.resultDetails.minPrice,
        maxPrice:         response.resultDetails.maxPrice,
        language:         response.params.language,
        filters:          response.params.filters
  
      });
    }
  }.bind(this));
  </code></pre>
  
  <p>How can I say something like <code>if response.params.language, set language</code>? I cannot figure out the React syntax to do such a thing.</p>