Skip to content
Snippets Groups Projects
Commit 098e381a authored by Tom Robinson's avatar Tom Robinson
Browse files

Prevent table from re-rendering when card changes

parent 6e5801e8
No related branches found
No related tags found
No related merge requests found
......@@ -76,10 +76,13 @@ export default class TableInteractive extends Component {
// if size changes don't update yet because state will change in a moment
this.calculateSizing(nextState);
// compare props and state to determine if we should re-render
// compare props (excluding card) and state to determine if we should re-render
// NOTE: this is essentially the same as React.addons.PureRenderMixin but
// we currently need to recalculate the container size here.
return !_.isEqual(this.props, nextProps) || !_.isEqual(this.state, nextState);
return (
!_.isEqual({ ...this.props, card: null }, { ...nextProps, card: null }) ||
!_.isEqual(this.state, nextState)
);
}
componentDidUpdate() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment