Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 2 months ago
JSON representation
named routes for react-router and your react application
- Host: GitHub
- URL: https://github.com/jhsu/react-router-namesake
- Owner: jhsu
- Created: 2018-04-20T07:45:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T03:03:50.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T19:31:52.326Z (2 months ago)
- Topics: react, react-router, routing
- Language: TypeScript
- Size: 1.41 MB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.markdown
- Contributing: CONTRIBUTING.md
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)