title: Storing ID's in react router URL to extract ID and make api call
body: <p>so I need to store two unique ID's into the url and extract the id's in another component to get data from the data base.</p>
  <p>This task requires me to send an email with a link to complete a task. If the task is deleted I need to know who sent the task email.</p>
  <p>Any information of the direction I should move in is appreciated.</p>
  <pre><code>import React from 'react';
  // current setup
  const Practice = () =&gt; {
      return (
        &lt;div&gt;
          &lt;Router&gt;
            &lt;Something path=&quot;/task/:id&quot; /&gt;
            &lt;Something path=&quot;/task/:id/:action&quot; /&gt;
          &lt;/Router&gt;
        &lt;/div&gt;
      );
    };
    
  export default practice;
  
  
  // desired setup
  // I need to store Id's and make it not break the website. like lets say optional values or something.
  // The only required value is the first /:id
  const Practice = () =&gt; {
      return (
        &lt;div&gt;
          &lt;Router&gt;
            &lt;Something path=&quot;/task/:id/:id?/:id?&quot; /&gt;
          &lt;/Router&gt;
        &lt;/div&gt;
      );
    };
    
  export default practice;
    
  { &quot; desired output is = localhost:3000/task/111111?222222?33333&quot; }
  { &quot;so that I can store the last two id's in an array = &quot;['localhost:3000/task/111111', '222222', '33333'] }
  
  //component
  const Task = ({ id, action, companyId, userId }) =&gt; {
  const company = companyId
  const user = userId
  }
  </code></pre>