title: dynamically pass unknown number of parameters to react router
body: <p>In my react App, I have the functionality to create Folders and Files. A folder can have any number of folders inside it.</p>
  
  <p>like so</p>
  
  <pre><code>Folder-1
    |_Folder-1-1
    |_Folder-1-2
      |_Folder-1-2-1
      |_Folder-1-2-2
        |_Folder-1-2-2-1
         .
         .
         .
  </code></pre>
  
  <p>and it can get deeper up to any level.
  Currently, What I am doing is. There's a component that loads the root folder <code>Folder-1</code>, When you click on <code>Folder-1</code>. I change the route and load another component.</p>
  
  <p>My route Looks like <code>&lt;Route exact path="/clients/:folder" component={ClientFolder} /&gt;</code></p>
  
  <p>But the problem here is I don't know the number of parameters.</p>
  
  <p>The way I envisioned it is</p>
  
  <ul>
  <li>You click on <code>Folder-1</code>, URL changes to <code>/clients/Folder-1</code>,
  Then, it loads all the Folders inside Folder-1, i.e <code>Folder-1-1</code>, and <code>Folder1-2</code></li>
  <li>You click on <code>Folder-1-2</code>, URL changes to <code>/clients/Folder-1/Folder-1-2</code>, Loads Files and folders inside <code>Folder-1-2</code></li>
  </ul>
  
  <p>and so on.</p>
  
  <p>So my question is, <strong>How can I have Any number of nested routes using a single route and a single Component</strong></p>
  
  <p>I am using react-router 5</p>