title: Element implicitly has an 'any' type because type 'xxx' has no index signature.ts(7017)
body: <p>I am having an issue with TS. I am getting the following error, for this branch of Code:</p>
  
  <p><strong>The Interface:</strong></p>
  
  <pre><code>export default interface IUser {
    username: string;
    email?: string;
    isActive: boolean;
    group: string[];
  }
  </code></pre>
  
  <p><strong>The interface that the name comes form:</strong></p>
  
  <pre><code>interface Field {
    name: string;
    label: string;
    placeholder: string;
    help?: string | React.ReactNode;
  }
  </code></pre>
  
  <p><strong>ERROR:</strong></p>
  
  <pre><code>Element implicitly has an 'any' type because type 'IUser' has no index signature.ts(7017)
  const user: IUser
  </code></pre>
  
  <p><strong>CODE:</strong></p>
  
  <pre><code>      mode === ActionMode.EDIT_INFO &amp;&amp; user &amp;&amp; user[name]
          ? {
              label: user[name],
              value: user[name]
            }
          : null;
  </code></pre>
  
  <p>I am reading in the TS Docs, the following:
  <a href="https://basarat.gitbooks.io/typescript/docs/types/index-signatures.html" rel="nofollow noreferrer">https://basarat.gitbooks.io/typescript/docs/types/index-signatures.html</a> </p>
  
  <p>Which led me to believe that I should do this:</p>
  
  <pre><code>    const defaultValue =
        mode === ActionMode.EDIT_INFO &amp;&amp; user &amp;&amp; user[name.toString()]
          ? {
              label: user[name.toString()],
              value: user[name.toString()]
            }
          : null;
  </code></pre>
  
  <p>But it didn't help. Can you explain what is wrong here? No can I not have something implicit here. Where should I reference the type?</p>