1.1.0 • Published 8 years ago

react-router-path-list v1.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

react-router-path-list

A (potentially naive) way to get an array of paths from a react-router path definition.

Usage

Install it: npm i --save react-router-path-list.

Then use it:

import pathList from 'react-router-path-list';

const paths = pathList(
  <Route path="/">
    <IndexRoute>
    <Route path="hello">
      <Route path="world"/>
    </Route>
  </Route>
);
// components removed for brevity

paths will be equal to:

[
  '/',
  '/hello',
  '/hello/world'
]

Why

Probsbly lots of things, but I need it to generate a list of paths for use with a react static site generator.

Contributing

Ideas, comments, and pull requests welcome.

1.1.0

8 years ago

1.0.0

8 years ago