title: Switch case inside JSX not working: ReactJS
body: <p>In my <code>reactjs</code> component - in the render, I want to create a switch case that will use particular components based on a switch case. But there is a syntax error here.</p>
  
  <p>Should I just make this as a function inside the component?</p>
  
  <p>Unexpected token (190:32)</p>
  
  <pre><code>  188 | 
    189 |   {
  &gt; 190 |     return (
        |     ^
  </code></pre>
  
  <p>Here is the full return function for the component:</p>
  
  <pre><code>return (
      &lt;div className="Page"&gt;
          ....
      {
          elements.map(function(element, index){
              return (
                  &lt;Col xs={24} sm={element["grid-width"]*2} md={element["grid-width"]} key={index} className="element-container"&gt;
                    .....
                        &lt;div className="contents"&gt;
                          {
                            return (
                              switch (element.type) { 
                                case 'we-are-always-here-to-help':
                                  sss
                                  break;
                                case 'call-us-when-you-are-having-difficulties':
                                  xx
                                  break;
                                default: 
                              }
                            )
                          }
                        &lt;/div&gt;
                  &lt;/Col&gt;
              )
          })
      }
      &lt;/div&gt;
  )
  </code></pre>