title: ES2015: How can I simplify an if statement with assignment?
body: <p>I am building a React component that returns diverse tags based on a condition. The code is the following:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// Header.jsx
  
  import React from 'react';
  
  const Header = ({...props}) =&gt; {
   let Tag;
   if (props.h1)
    Tag = 'h1';
   else if (props.h2)
    Tag = 'h2';
   else if (props.h3)
    Tag = 'h3';
   else if (props.h4)
    Tag = 'h4';
   else if (props.h5)
    Tag = 'h5';
   else
    Tag = 'h6';
  
   return (
    &lt;Tag&gt;
     { children }
    &lt;/Tag&gt;
   );
  }
  
  export default Header;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I though ES2015 would support if as expressions, so I tried <code>let Tag = (if (expression) [...]);</code>, but it seems that it doesn't support. How can I simplify this snippet?</p>