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

Does mapDispatchToProps run more than once? #563

Closed
davegri opened this issue Dec 8, 2016 · 1 comment
Closed

Does mapDispatchToProps run more than once? #563

davegri opened this issue Dec 8, 2016 · 1 comment

Comments

@davegri
Copy link

davegri commented Dec 8, 2016

I was under the impression that mapDispatchToProps runs only once.
I'm trying to increase application performance using the following guide:
http://benchling.engineering/deep-dive-react-perf-debugging/

Inside the guide there is a Mixin I'm using which tells me about avoidable updates. (A prop is deeply equal but not shallowly, causing an avoidable render)

Some of the output I'm getting is about functions that come from mapDispatchToProps. Could it be that mapDispatchToProps is run more than once? how is this possible? What am I missing?

@jimbolla
Copy link
Contributor

jimbolla commented Dec 8, 2016

If your mapDispatchToProps function depends on props (has args length !== 1) then it's called anytime the component receives new props.

@jimbolla jimbolla closed this as completed Dec 8, 2016
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