title: Correct way (if possible) to store JSX code into a Javascript variable
body: <p>I´ve written the following code using <code>ReactJs´s JSX</code> syntax:</p>
  
  <pre><code>import { Link } from 'react-router';
  
  class SidebarMenuItem extends React.Component {
  
  render() {
  
      var href = (this.props.submenu ? 'javascript:' : {&lt;Link to="mod/admin" + this.props.link /&gt;};
  
      return ( 
  
          &lt;a href={href} onClick={this.selected}&gt;
              &lt;i className={'fa ' + this.props.icon} /&gt;
              &lt;span&gt;{this.props.title}&lt;/span&gt;
          &lt;/a&gt;
  
      )
    }
  }
  </code></pre>
  
  <p>But it seend that I cannot store a direct JSX code into a variable, as I got the following error:</p>
  
  <pre><code>Module build failed: SyntaxError: D:/9. DEV/client/components/App/SidebarMenuItem.js: Unexpected token, expected , (41:52)
  
    40 | 
  &gt; 41 |      var href = (this.props.submenu ? 'javascript:' : {&lt;Link to="mod/admin" + this.props.link /&gt;};
       |                                                        ^
  </code></pre>
  
  <p>What  is the correct way to store my Link component in the <code>href</code> variable ?</p>