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

请教个问题,关于返回的state是否需要是新对象? #40

Closed
Skypow2012 opened this issue Oct 30, 2020 · 1 comment
Closed

Comments

@Skypow2012
Copy link

simplest-redux-example/index.js:35
这个counter函数的default是不是返回一个新的state会比较好?比如return {...state}

@jackielii
Copy link
Owner

simplest-redux-example/index.js:35
这个counter函数的default是不是返回一个新的state会比较好?比如return {...state}

正确的方式是返回原来的state, 很少的情况要clone一个新的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

2 participants