Skip to content

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

@melodymeteng

Description

@melodymeteng

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions