-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Hi,
I have a conditionally displayed component, based on a value in redux. All components below are connected.
eg in a wrapper component's render method:
{ (showValueInRedux) ? <ComponentUsingShowValue/> : <EmptyComponent/> }
ComponentUsingShowValue has a mapStateToProps that uses redux state that it expects to be there, hence we guard for that with showValueInRedux in the wrapper component.
In version 6, mapStateToProps in ComponentUsingShowValue is only called when that component is due to render.
In version 7, mapStateToProps is called even if the wrapping component has switched to choosing EmptyComponent due to showValueInRedux being false (after having once been true).
This causes an exception in our current code because the redux values that mapStateToProps uses ( in the now non-rendered component) are not available.
Please could you clarify this change in behaviour?