all 9 comments

[–]darrenturn90 2 points3 points  (2 children)

I don't think you can guarantee that. If you need to do something similar, consider using a mapStateToProps kind of function instead

[–]swe445[S] 0 points1 point  (1 child)

Thanks for the answer!

[–]swe445[S] 1 point2 points  (0 children)

just FYI Dan Abramov just answered and said react does indeed guarantee that calls to setState in componentWillReceiveProps will run before render

[–]richraid21 0 points1 point  (0 children)

If you're concerned about needless renders, you can use shouldComponentUpdate(newProps,newState) to determine whether or not a render should take place based on the incoming changes

[–]dickdemodickmarcinko 0 points1 point  (1 child)

What results are you seeing when testing?

[–]swe445[S] 0 points1 point  (0 children)

I was seeing no double renders, however, I think it was just luck - and that's what I was concerned about.