title: Passing a parameter to use a property key. Javascript
body: <p>How do you pass a parameter to a function that you can use a property key.</p>
  
  <p>For example</p>
  
  <pre><code>myFunctionToSetState = (propertyName) =&gt; {
  
      //I want to use the string I pass as the key in my new object
      this.setState({ propertyName: newValue});
  }
  
  //I'm calling the function like this
  this.myFunctionToSetState('myPropertKey');
  </code></pre>
  
  <p>It seems that propertyName is never the parameter I passed and is always a key called propertyName.</p>
  
  <p>I want to basically pass a property of my redux state to this function at update accordingly. The value I'm setting is actually an image uri. However I have multiple pictures I want to reference.</p>
  
  <p>Thanks</p>