Skip to content

Commit

Permalink
Fix cellContext no longer triggering rerenders
Browse files Browse the repository at this point in the history
- performance changes worked I guess!
  • Loading branch information
cee-chen committed Mar 8, 2024
1 parent b1ea642 commit 6982d58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/datagrid/body/cell/data_grid_cell.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ describe('EuiDataGridCell', () => {
style: { top: 0, left: 0, width: 50, height: 10 },
});
});
it('cellContext', () => {
component.setProps({ cellContext: { someData: true } });
component.setProps({ cellContext: { someData: false } });
});
});

describe('when state changes:', () => {
Expand Down
1 change: 1 addition & 0 deletions src/components/datagrid/body/cell/data_grid_cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ export class EuiDataGridCell extends Component<
if (nextProps.style.width !== this.props.style.width) return true;
}

if (nextProps.cellContext !== this.props.cellContext) return true;
if (nextState.cellProps !== this.state.cellProps) return true;
if (nextState.isFocused !== this.state.isFocused) return true;
if (nextState.isHovered !== this.state.isHovered) return true;
Expand Down

0 comments on commit 6982d58

Please sign in to comment.