mirror of
https://github.com/wassname/talk.git
synced 2026-07-12 00:33:54 +08:00
Better shouldComponentUpdate detection in withFragments
This commit is contained in:
@@ -86,9 +86,9 @@ export default (fragments) => hoistStatics((BaseComponent) => {
|
||||
}
|
||||
|
||||
shouldComponentUpdate(next) {
|
||||
const onlyQueryDataChanges = this.shallowChanges.every((key) => this.fragmentKeys.indexOf(key) >= 0);
|
||||
|
||||
// If only query data was changed.
|
||||
if (this.queryDataHasChanged && this.shallowChanges.every((key) => this.fragmentKeys.indexOf(key) >= 0)) {
|
||||
if (onlyQueryDataChanges) {
|
||||
return this.queryDataHasChanged;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user