title: Looking for a better algorithm (conditional rendering)
body: <p>On my webapplication I use a json file to store my different routes, and I loop over an array inside this json file to create content, such navbar buttons.</p>
  
  <p>The problem I face is that I would like to use a different icon for each value displayed from the json file, and I cannot store the icon component into the json file.</p>
  
  <p>Here is my sample of code with the loop on the array contained in the json file</p>
  
  <pre><code>{props.buttons.button.map((button, index) =&gt; (
                  &lt;div key={index}&gt;
                      {(button.isAuth === props.isAuth || button.isAuth === 3) &amp;&amp; (
                          &lt;&gt;
                              &lt;Link to={button.to} className="link"&gt;
                                  &lt;ListItem button&gt;
                                      &lt;ListItemIcon&gt;
                                          &lt;InputIcon /&gt;
                                      &lt;/ListItemIcon&gt;
                                      &lt;ListItemText primary={button.label} /&gt;
                                  &lt;/ListItem&gt;
                              &lt;/Link&gt;
                          &lt;/&gt;
                      )}
                  &lt;/div&gt;
              ))}
  </code></pre>
  
  <p>Here is a sample of the json file </p>
  
  <pre><code>{
      "button": [
          {
              "label": "Home",
              "isAuth": 3,
              "to": "/"
          },
          {
              "label": "About",
              "isAuth": 3,
              "to": "/about"
          }
      ]
  }
  
  </code></pre>
  
  <p>Currently, for each data on my json file, always the same icon component is displayed : <code>&lt;InputIcon /&gt;</code>.</p>
  
  <p>How can I display a different icon component for each data from the json file (such as <code>&lt;HomeIcon /&gt;</code> for the home button, <code>&lt;LogInIcon /&gt;</code> for the login one, ...) without using and <code>if/else</code></p>
  
  <p>Thanks</p>