title: Alternate way for optional parameters in v6
body: <p>In v5, we could add trailing <code>?</code> to route for optional parameters, but as in v6, the support for the same has been dropped, so what's the alternate way of writing the following piece of code?</p>
  <p><code>&lt;Route path=&quot;/cart/:id?&quot; component={&lt;CartPage /&gt;} /&gt;</code></p>