egg-react-webpack-boilerplate
egg-react-webpack-boilerplate copied to clipboard
纯前端项目改造ssr,遇到combineReducers的问题
在创建store的过程中,传入的reducers做了改造。使用combineReducers来生成rootReducers。项目会警告:
Unexpected keys "ctx", "request", "helper", "gettext", "__", "csrf", "url" found in preloadedState argument passed to createStore. Expected to find one of the known reducer keys instead: "userInfo", "loading", "exam", "list", "landingInfo". Unexpected keys will be ignored.
打包后,npm start访问,会报500错误。
请问这个问题应该怎么解决呢?或者reducer应该怎么组织呢
@salody 不要把整个 context 传到 store 里面, 自己过滤一下 state ,排除一下 ctx,request 这个几个 或者只取 userInfo,list 这个几个