import {Router} from 'react-router'import createBrowserHistory from 'history/createBrowserHistory'const history = createBrowserHistory();const store = rehydrate();const renderApp = Component => { render( <Router history={history}> <App/> </Router>, document.getElementById("root") );};這樣寫不是會直接注入history嗎?我在App里面用this.props.hist6ory.push()就報(bào)錯(cuò)!要從context里面取嗎?
Cannot read property 'push' of undefined react
回首憶惘然
2018-12-20 18:15:50