kdchang / reactjs101

從零開始學 ReactJS(ReactJS 101)是一本希望讓初學者一看就懂的 React 中文入門教學書,由淺入深學習 ReactJS 生態系 (Flux, Redux, React Router, ImmutableJS, React Native, Relay/GraphQL etc.)。
https://www.gitbook.com/book/kdchang/react101/details
Other
4.3k stars 1.22k forks source link

#勘误#CH10_react-router-redux-node-isomorphic-open-cook #50

Open zhangzhenfei opened 7 years ago

zhangzhenfei commented 7 years ago

项目中的的AppBarContainer代码有误

dispatch(setRecipe({ key: 'recipeId', value: '' }));
//改成
dispatch(setRecipe({ keyPath: ['recipe', 'id'], value: '' }));

另外,我很奇怪,为嘛WebAPI的action,dispatch后,使用路由跳转,为啥要页面重新加载一次。。。

window.location.reload(); 
browserHistory.push('/'); 

这样不就失去单页应用的意义了?而且项目操作起来很不顺畅。。感觉不是这样用的

kdchang commented 7 years ago

sorry, let me check it later :) The case purpose is not single page app, but server side rendering.