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

demo-4中不用给createdStore传入initState #1

Open
melodymeteng opened this issue Apr 16, 2020 · 0 comments
Open

demo-4中不用给createdStore传入initState #1

melodymeteng opened this issue Apr 16, 2020 · 0 comments

Comments

@melodymeteng
Copy link

demo-4中不用给createdStore传入initState这个例子中,在combineReducer中应该有
if (prevStateForKey) {
nextState[key] = nextStateForKey;
} else {
nextState[key] = nextStateForKey[key];
}
不然会导致初始state树的时候生成一个{initState[第一个key]=initState整个对象,initState[第二个key]=initState整个对象}这样的state

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

No branches or pull requests

1 participant