Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaredly/react-router
An integrated router for react
https://github.com/jaredly/react-router
Last synced: 23 days ago
JSON representation
An integrated router for react
- Host: GitHub
- URL: https://github.com/jaredly/react-router
- Owner: jaredly
- Created: 2014-02-02T03:40:04.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-07-15T22:10:56.000Z (over 10 years ago)
- Last Synced: 2024-10-03T12:39:29.878Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 221 KB
- Stars: 33
- Watchers: 5
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
React Router is heavily inspired by Ember, but with some key differences that
are distinctive to the React paradigm.It is implemented as a mixin.
**currently in heavy development**
Benefits:
- route is tied to state
- setting page title is handled for you
- routes are defined declaratively
- routes are defined locally, one level at a time```js
var Router = require('react-router')
, ListProjects = require('./list-projects.jsx')
, NewProject = require('./new-project.jsx')
, Project = require('./project.jsx')var Projects = React.createClass({
mixins: [Router],
routes: {
'/': ListProjects,
'/new': NewProject,
'/*': [Project, function () {
return {
projectList: this.goTo.bind(null, '/')
}
}]
},
title: function () {
return 'Project List'
},
render: function () {
return (
{this.outlet()}
)
}
})```