title: TypeScript generics: void, never, or undefined?
body: <p>Always wondering about this. So want to get a definite answer and set it to stone :)</p>
  
  <p>What I want to do is to let the compiler/language service/reader knows that <code>T</code> should be nothing, empty, nada. I want to know which one (<code>void</code>, <code>never</code>, <code>undefined</code>) is the right / best one to use.</p>
  
  <pre><code>// to indicate there should be no props available
  class MyComponent extends React.Component&lt;???, any&gt; { ... }
  
  // showing the Promise should resolve to nothing
  function foo(): Promise&lt;???&gt; { ... }
  </code></pre>
  
  <p>( let me know if you can think of other cases you need to think about using <code>void</code>, <code>never</code>, or <code>undefined</code> in generics and I can add them to this list )</p>
  
  <p>Related questions:
  <a href="https://stackoverflow.com/questions/37910669/what-is-the-difference-between-never-and-void-in-typescript">What is the difference between never and void in typescript?</a></p>
  
  <p>From the above link, and the answer from @mierion-hughes, <code>never</code> seems to be clear. So the remaining question is <code>void</code> vs <code>undefined</code></p>