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

infinite loop in mapstate to props #48

Closed
alexkuhn opened this issue Apr 17, 2019 · 0 comments
Closed

infinite loop in mapstate to props #48

alexkuhn opened this issue Apr 17, 2019 · 0 comments

Comments

@alexkuhn
Copy link
Contributor

TODO app with following mapStateToProps:

function mapStateToProps(state) {
  return { todos: state.todos.sort((t1, t2) => t1.title > t2.title ? -1 : 1) };
}

add an item => infinite loop

maybe prevent mutating state inside mapStateToProps?

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