-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moved queriesArray from render() to local state #1505
Moved queriesArray from render() to local state #1505
Conversation
is only reloaded only during switching tabs or queries object is updated.
@@ -94,3 +94,18 @@ export function areArraysShallowEqual(arr1, arr2) { | |||
} | |||
return true; | |||
} | |||
|
|||
export function areObjectsEqual(obj1, obj2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a missing case here where obj2 has properties that are not in obj1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added length comparison in latest commit
queriesArray.push(this.props.queries[id]); | ||
} | ||
} | ||
this.setState({ queriesArray }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it would be kosher to mutate nextProps
in componentWillReceiveProps
the docs don't seem to say whether it is...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember that props are immutable, why would we want to mutate nextProps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind, that was bad idea!
LGTM! |
Before:
After:
needs-review @mistercrunch