title: React route params with default value
body: <p>I am using react functional component with react router v5 . I am using useParam function to fetch a param. How can I set default value of the param when it is not available or undefined.</p>
  <p>My router code</p>
  <pre><code>&lt;Switch&gt;
      // ....
      // .... 
      &lt;Route path=&quot;/users/:userId?&quot; component={UserInfo} /&gt;
      // ....
  &lt;/Switch&gt;
  </code></pre>
  <p>My component code</p>
  <pre><code>export const UserInfo = (props) =&gt; {
      const {userId} = useParams()
  
  
      // ... other codes 
  }
  </code></pre>
  <p>I am getting <code>undefined</code> when calling http://localhost:3000/users/.</p>
  <p>Any idea will be helpful.</p>