title: TypeScript error Element implicitly has an 'any' type because expression of type 'any' can't be used to index type
body: <p>I am getting this error:</p>
  <pre><code>  Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{ foo: string; bar: string; }'.ts(7053)
  </code></pre>
  <p>In this code:</p>
  <pre><code>const CATEGORY_COLORS = {
    foo: '#6f79F6',
    bar: '#4fA0E9',
  };
  
  const CATEGORY_LABELS = {
    foo: 'FOO',
    bar: 'BAR',
  };
  
  const ItemRenderer = ({ item }: ItemRendererPropsType): React.ReactElement =&gt; {
    return (
      &lt;div&gt;
        &lt;Tag color={CATEGORY_COLORS[item.category]}&gt;
          {CATEGORY_LABELS[item.category]}
        &lt;/Tag&gt;
      &lt;/div&gt;
    );
  };
  </code></pre>
  <p>The error is when I hover over either <code>CATEGORY_COLORS[item.category]</code> or <code>CATEGORY_LABELS[item.category]</code> with TypeScript. How do I resolve?</p>