Skip to content

Commit

Permalink
update react-router to v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
minwe committed Mar 3, 2016
1 parent 4903567 commit 272772a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 20 deletions.
3 changes: 0 additions & 3 deletions docs/_app/js/Sidebar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import {
Link,
History,
} from 'react-router';
import {
Container,
Expand Down Expand Up @@ -117,8 +116,6 @@ const components = [
];

const Sidebar = React.createClass({
mixins: [History],

getInitialState() {
return {
filter: null
Expand Down
10 changes: 6 additions & 4 deletions docs/_app/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Route,
Link,
IndexRoute,
History,
hashHistory,
} from 'react-router';

import {
Expand All @@ -16,7 +16,9 @@ import ComponentDoc from './ComponentDoc';
import Index from './Index';

const Header = React.createClass({
mixins: [History],
contextTypes: {
router: React.PropTypes.object.isRequired
},

getInitialState() {
return {
Expand All @@ -34,7 +36,7 @@ const Header = React.createClass({
const pathName = `/${route}`;

return (
<li className={this.history.isActive(pathName) ? 'am-active' : ''}>
<li className={this.context.router.isActive(pathName) ? 'am-active' : ''}>
<Link to={pathName}>{title}</Link>
</li>
);
Expand Down Expand Up @@ -108,7 +110,7 @@ const GettingStarted = React.createClass({
});

const routes = (
<Router>
<Router history={hashHistory}>
<Route path="/" component={App}>
<Route path="docs" component={App.Components}>
<Route path=":component" component={ComponentDoc} />
Expand Down
6 changes: 0 additions & 6 deletions docs/_utils/Highlight.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import React from 'react';
import CSSTransitionGroup from 'react-addons-css-transition-group';
import Clipboard from 'clipboard';
import {
History,
Link,
} from 'react-router';
import Prism from './Prism';

const Highlight = React.createClass({
mixins: [History],

propTypes: {
language: React.PropTypes.string,
},
Expand Down
8 changes: 2 additions & 6 deletions kitchen-sink/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Router,
Route,
Link,
History,
hashHistory,
IndexRoute,
} from 'react-router';

Expand Down Expand Up @@ -79,10 +79,6 @@ const NotFound = React.createClass({
});

const Detail = React.createClass({
// DO NOT NEED HERE.
// https://github.com/rackt/react-router/blob/master/docs/API.md#history-mixin
// mixins: [History],

render() {
let component = this.props.params.component;

Expand Down Expand Up @@ -117,7 +113,7 @@ const Detail = React.createClass({
});

const routes = (
<Router>
<Router history={hashHistory}>
<Route path="/" component={App}>
<Route path=":component" component={Detail} />
<IndexRoute component={Default} />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"marked": "^0.3.5",
"markedify": "0.0.2",
"merge-stream": "^1.0.0",
"react-router": "^1.0.0",
"react-router": "^2.0.0",
"run-sequence": "^1.1.4",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
Expand Down

0 comments on commit 272772a

Please sign in to comment.