title: How to make multiple react Route where the path is almost same except the id
body: <p>I have an object called machines object.This object has it's unique key.Now i want to make Route like <code>path={&quot;/machine&quot; + key}</code> for all the machines.I am trying to do it like the following but it doesn't work</p>
  <pre><code>{Object.keys(this.state.machines).forEach((key, index) =&gt; {
    // console.log(this.state.machines[key].machineNo)
    &lt;Route
      exact
      path={&quot;/machine&quot; + key}
      component={() =&gt; (
        &lt;MachineComposition machine={this.state.machines[key]} /&gt;
      )}
    /&gt;
  })}
  </code></pre>