title: React set state property dynamically
body: <p>I'm using react and I have some methods to set the state of my COmponent separately.
  I have the following methods:</p>
  
  <pre><code>setLineColor(value){
    this.setState({stroke:value},()=&gt;{
    this.props.data(this.getStyleData());
   });
  }
  setFillColor(value){
   this.setState({ fill:value},()=&gt;{
   this.props.data(this.getStyleData());
   });
  }
  setMode(value){
   this.setState({ mode:value},()=&gt;{
   this.props.data(this.getStyleData());
   });
  }
  </code></pre>
  
  <p>How can I combine the methods, so that I can have something like:</p>
  
  <pre><code>setAttribute(propery,value){...}
  </code></pre>
  
  <p>? </p>