Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jhsu/react-router-namesake

named routes for react-router and your react application
https://github.com/jhsu/react-router-namesake

react react-router routing

Last synced: 12 days ago
JSON representation

named routes for react-router and your react application

Awesome Lists containing this project

README

        

![react-router-namesake logo](logo.png)

# react-router-namesake
[![Build Status](https://travis-ci.org/jhsu/react-router-namesake.svg?branch=master)](https://travis-ci.org/jhsu/react-router-namesake)

## Example

```jsx
import { Switch } from "react-router";
import { BrowserRouter, Route, Link } from "react-router-dom";
import { Router as NamesakeRouter, WithNamesake, NamesakeLink, NamesakeRoute } from "react-router-namesake";

const ButtonLink = ({ to, params }) => {
return {({ routes }) => (
routes.transitionTo(path, params)}>{this.props.children}
)};
}

const App = () => (



{({ history }) => (



Home
users

user id 123


This renders for /user/:userId


Go to User 123



Home




Users Page




A User's Page






)}


);
```

[demo](https://codesandbox.io/s/2o6mv5nx5p)