突然发现这个问题!
就是一个路由点击两次后,列表数据就消失了,并报错;
componentDidMount() {
let { actions } = this.props;
actions.meetingLoad();
}
上面的这段代码就无法执行。
按理说选中的路由再次点击应该没什么反映才对,怎么react 又执行了 render() 看日志是route 触发的。
请问这个问题错误是发生在哪里?怎么发生的。路由代码如下
const routes = (
<Route path="/" component={App}>
<IndexRoute component={HomePage} />
<Route path="home" component={HomePage} />
<Route path="meetings" component={Meetings} />
<Route path="/meetings/:mid/cals" component={CalList} />
</Route>)
export default routes
-----------
const state = window.__initialState__ || undefined
const store = configureStore(hashHistory,state)
const history = syncHistoryWithStore(hashHistory, store)
ReactDOM.render(
<Provider store={store}>
<Router history={history} routes={routes}/>
</Provider>, document.getElementById('root'))
registerServiceWorker()
const Navigation = ({ className, buttonClassName }) => (
<nav className={className}>
<IndexLink className={buttonClassName} activeClassName="Active" to="/">欢迎</IndexLink >
<Link className={buttonClassName} activeClassName="Active" to="meetings">会议管理</Link>
</nav>
)