Is there an existing library that will reduce my route instance to an array of paths?
Example:
As I did not find anything, I ended up creating a library for that...
https://github.com/alansouzati/react-router-to-array
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import reactRouterToArray from 'react-router-to-array';
// or var reactRouterToArray = require('react-router-to-array');
console.log(reactRouterToArray(
{/* just to test comments */}
)
); //outputs: ['/', '/about', '/about/home', '/users']