React Router: get all routes as array
<p>Is there an existing library that will reduce my route instance to an array of paths?</p>

<p><strong>Example</strong>:</p>

<pre><code>    &lt;Route path="/" component={App}&gt;
      &lt;Route path="author" component={Author}&gt;
        &lt;Route path="about" component={About}/&gt;
      &lt;/Route&gt;
      &lt;Route path="users" component={Users} /&gt;
    &lt;/Route&gt;
</code></pre>

<p><strong>Output</strong></p>

<pre><code>['/', '/author', '/author/about', '/users']
</code></pre>

<p>I could write a reduce function that will have few lines of code and solve that, but I was wondering if there is an existing library that will do that for me and take care of the different ways of representating routes using react router.</p>