Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

纯前端项目改造ssr,遇到combineReducers的问题 #43

Open
salody opened this issue Aug 1, 2019 · 1 comment
Open

纯前端项目改造ssr,遇到combineReducers的问题 #43

salody opened this issue Aug 1, 2019 · 1 comment

Comments

@salody
Copy link

salody commented Aug 1, 2019

在创建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应该怎么组织呢

@hubcarl
Copy link
Collaborator

hubcarl commented Aug 3, 2019

@salody 不要把整个 context 传到 store 里面, 自己过滤一下 state ,排除一下 ctx,request 这个几个 或者只取 userInfo,list 这个几个

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants