title: How to return a jsx element with an inline switch?
body: <p>I am trying to return an element with an inline switch. But I am getting only a empty <code>&lt;span&gt; &lt;/span&gt;</code>. What am I doing wrong?</p>
  
  <pre><code> getRowTdForHeader: (header: string, entry: response) =&gt; {
              return (&lt;span&gt;
                  {() =&gt; {
                      switch (header) {
                          case "Name":  return entry.name;
                          case "Type": return entry.type;
                          default: return entry.name;
                      }
                  } }
              &lt;/span&gt;);
          }
  </code></pre>
  
  <p>Result is a empty <code>span</code> and if I put a breakpoint at the return, it never goes into the switch statement at all. I'd like to keep it as a in-liner if possible. The switch works fine if I don't inline it btw.</p>