Skip to content

Commit

Permalink
fix: redux connect memo issue related to spec upserting (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickofthyme authored Feb 21, 2020
1 parent 1ed6957 commit b5d8489
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/state/spec_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,12 @@ const mapDispatchToProps = (dispatch: Dispatch): DispatchProps =>
);

export function getConnect() {
return connect(null, mapDispatchToProps);
/**
* Redux assumes shallowEqual for all connected components
*
* This causes an issue where the specs are cleared and memoized spec components will never be
* rerendered and thus never re-upserted to the state. Setting pure to false solves this issue
* and doesn't cause traditional performance degradations.
*/
return connect(null, mapDispatchToProps, null, { pure: false });
}

0 comments on commit b5d8489

Please sign in to comment.