preact-redux icon indicating copy to clipboard operation
preact-redux copied to clipboard

Partially connected component is not updated in 2.1.0

Open Reeywhaar opened this issue 6 years ago • 2 comments

Hi! Can't wrap my head around simple issue: Given we have a component and and its connected counterpart, the latter is not updated when it receives props.

Made reproducible: https://codesandbox.io/s/sharp-moore-l1gcq

Am I doing something wrong? I've tried all combinations of withRef and pure and still no luck. Also everything works fine in 2.0.3.

Thanks!

Reeywhaar avatar Sep 29 '19 17:09 Reeywhaar

Had the same issue 2 days ago (hence the reference of your issue) seems like mapStateToProps is only being called after the first state update (from nothing to something) but not when updating an array, object or string.

I also reverted back to 2.0.3 and now everything works fine...

kriskuiper avatar Oct 25 '19 15:10 kriskuiper

I was bit by this bug. Connected component does not rerender when receiving ownProps. Issue is resolved by downgrading preact-redux to 2.0.3. Thanks to @Reeywhaar for a clear demo of this issue.

Bug was experienced with these package versions: Preact 8.5.3 Redux 4.0.4 Preact-Redux 2.1.0

michaeljsalo avatar Feb 13 '20 17:02 michaeljsalo