引入中间件
import { routerReducer as routing, routerMiddleware } from 'react-router-redux';
import { browserHistory } from 'react-redux';
const finalCreateStore = compose(
applyMiddleware(
routerMiddleware(browserHistory)
)
)(createStore);
使用的时候
handleClick (e) {
this.props.push('/signin')
}
点击之后就会报错
Uncaught TypeError: Cannot read property 'push' of undefined