title: How to statically type a string property within a React component using Typescript
body: <p>I have a React component that is a text field abstraction.</p>
  
  <pre><code>&lt;TextField
      label="Enter your user name"
      dataSource={vm}
      propertyName="username"
      disabled={vm.isSaving}
  /&gt;
  </code></pre>
  
  <p><code>vm</code> is a view model object injected as a prop into the view. <code>username</code> is a property within <code>vm</code>. <code>vm</code> uses mobx and <code>&lt;TextField /&gt;</code> mutates the <code>vm</code> object as the user types.</p>
  
  <p>How can I use typescript to restrict the <code>propertyName</code> field to only properties of the <code>vm</code> object?</p>
  
  <p>Notes:</p>
  
  <ul>
  <li>I use <code>&lt;TextField /&gt;</code> in multiple places, where each time the <code>vm</code> object is different and does not share a common interface. </li>
  </ul>