v3.0.0-alpha
Pre-releaseBreaking Change
Now the map functions (mapStateToProps
, mapDispatchToProps
and mergeProps
) are not called until React starts to render the connect()
ed components. Previously the map functions where called immediately when store changed which could cause weird edge case bugs when the ownProps
parameter was a derivative of the state. The state from which it was derivative of was a different version than what was passed as the state
parameter. In some cases the states can be incompatible with each other and cause very confusing bugs in user code.
Unfortunately the states stay consistent only when store dispatches are called in batches ie. from DOM handlers or manually from ReactDOM.unstable_batchedUpdates(fn)
. Luckily redux-batched-updates
middleware can be used to force batching for all dispatches.
If you're interested in the details, feel free to check out: