site: fix react-router warning

This commit is contained in:
Benjy Cui 2016-03-29 12:00:14 +08:00
parent 7692bf3d42
commit b0fc16c3fc

View File

@ -43,7 +43,7 @@ export default class Header extends React.Component {
}
handleSearch(value) {
this.props.history.push({ pathname: value });
this.context.router.push({ pathname: value });
}
handleSelectFilter(value, option) {
@ -137,3 +137,7 @@ export default class Header extends React.Component {
);
}
}
Header.contextTypes = {
router: React.PropTypes.object.isRequired,
};