我正在使用此代码创建路由 redux 路由器
import React from 'react'
import ReactDOM from 'react-dom'
import { createStore, combineReducers } from 'redux'
import { Provider } from 'react-redux'
import { Router, Route, browserHistory } from 'react-router'
import { syncHistoryWithStore, routerReducer } from 'react-router-redux'
import Calendar from '../calendar/calendar'
import Cards from '../cards/cards'
const history = syncHistoryWithStore(browserHistory)
const App= () => {
return <div>
<h2>start</h2>
<a href="/calendar">calendar</a>
<a href="/cards">cards</a>
</div>
}
const store = createStore(
combineReducers({
routing: routerReducer
})
)
ReactDOM.render(
<Provider store={store}>
{ /* Tell the Router to use our enhanced history */ }
<Router history={history}>
<Route path="/" component={App}>
<Route path="calendar" component={Calendar}/>
<Route path="cards" component={Cards}/>
</Route>
</Router>
</Provider>,
document.getElementById('mount')
)
我收到此错误
“未捕获的类型错误:无法读取未定义的属性‘getState’”
我正在尝试在应用程序 redux 上实现路由器 redux 谢谢
卡洛斯·维埃拉