title: react hooks and typescript - Property '***' does not exist on type 'never'
body: <p>I have come across this from numerous angles, and currently my code looks like this, and I get the following error:</p>
  
  <blockquote>
    <p>Property 'albums' does not exist on type 'never'</p>
  </blockquote>
  
  <p>I am using React hooks, but getting an error from the <code>data</code> object updated with <code>useState</code>. <code>data</code> has an property <code>albums</code> that I am not sure how to define, or where to do this.</p>
  
  <pre><code>import React, { useState } from 'react';
  
  interface ArtistProps {
     artistName: string,
  }
  
  
  const Artist: React.SFC&lt; ArtistProps &gt; = ({ artistName }) =&gt; {
  
      const [data, setData] = useState(null);
  
      return (
          &lt;&gt;
              &lt;p&gt;{artistName)}&lt;/p&gt; // this is fine
              &lt;p&gt;{data.albums}&lt;/p&gt; // error here
          &lt;/&gt;
      );
  }
  </code></pre>