title: React + Typescript: Type of React component with no state/no props
body: <p>I've seen multiple examples of React components using Typescript:</p>
  
  <p><code>class Foo extends React.Component&lt;IProps, IState&gt; {}</code></p>
  
  <p>It seems there is no a clear convention when we don't use either the Props or the State.</p>
  
  <p>People set these types as <code>any</code>, <code>null</code>,<code>undefined</code>,<code>{}</code>, <s><code>void</code></s>, etc.This is what I've seen so far:</p>
  
  <ol>
  <li><code>class Foo extends React.Component&lt;null, null&gt; {}</code></li>
  <li><code>class Foo extends React.Component&lt;any, any&gt; {}</code></li>
  <li><code>class Foo extends React.Component&lt;{}, {}&gt; {}</code></li>
  <li><code>class Foo extends React.Component&lt;undefined, undefined&gt; {}</code></li>
  <li><s><code>class Foo extends React.Component&lt;void, void&gt; {}</code></s></li>
  <li><code>class Foo extends React.Component&lt;object, object&gt; {}</code></li>
  </ol>
  
  <p>What's the best way of doing it?</p>
  
  <p><strong>Update:</strong></p>
  
  <ul>
  <li><p><strong>Props:</strong></p>
  
  <ul>
  <li><code>void</code> <strong>cannot</strong> be used  (<a href="https://github.com/Microsoft/TypeScript/issues/15409" rel="noreferrer">https://github.com/Microsoft/TypeScript/issues/15409</a> and <a href="https://github.com/Microsoft/TypeScript/issues/15419" rel="noreferrer">https://github.com/Microsoft/TypeScript/issues/15419</a> ) as the props object is initialised to <code>{}</code></li>
  </ul></li>
  </ul>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>Simply do - <code>class Foo extends React.Component {}</code> as prop and state are initialised to <code>{}</code></p>