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 committed Feb 21, 2020
1 parent 0479ba7 commit f3a05f1
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 f3a05f1

Please sign in to comment.