title: Using random array strings to type object keys/properties - TypeScript
body: <p>I would like to have a dynamic <code>Array&lt;string&gt;</code> that then makes a dynamic <code>Object</code> with the <code>key</code>/<code>property</code> from the array's values. (using for a prop usage in reactjs typescript)</p>
  
  <p>here's an example code:</p>
  
  <pre><code>interface Props {
    buttons: Array&lt;string&gt;;
    buttonProps?: { [key: string]: string }; //want key here to correspond with values of buttons
  }
  </code></pre>
  
  <p>I am guessing you use generics here but I am unsure on how to proceed with that.</p>