From 51365d062790ae080e35b610e2907cc99883b16b Mon Sep 17 00:00:00 2001 From: Pawel Date: Wed, 16 Apr 2025 13:49:32 +0200 Subject: [PATCH 1/2] remove lodash deepcompare from cell memoization --- reactgrid/lib/components/CellContext.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reactgrid/lib/components/CellContext.tsx b/reactgrid/lib/components/CellContext.tsx index 2efff140..4a4bada7 100644 --- a/reactgrid/lib/components/CellContext.tsx +++ b/reactgrid/lib/components/CellContext.tsx @@ -1,7 +1,6 @@ import { createContext, memo, useContext } from "react"; import { Cell, CellContextType } from "../types/PublicModel"; import { StickyOffsets } from "../types/InternalModel"; -import { deepCompare } from "../utils/deepCompare"; interface CellContextProviderProps { rowIndex: number; @@ -79,7 +78,7 @@ export const CellContextProvider = memo( (prev, next) => { return ( !next.shouldRenderReorderedCells && - deepCompare(prev.cell, next.cell) && + prev.cell === next.cell && prev.isSelected === next.isSelected && prev.isFocused === next.isFocused && prev.getCellOffset === next.getCellOffset From a8dffd7b7be3dd14a00241c8bc9521510ae4880b Mon Sep 17 00:00:00 2001 From: Pawel Date: Wed, 16 Apr 2025 13:49:32 +0200 Subject: [PATCH 2/2] remove lodash deepcompare from cell memoization --- reactgrid/lib/components/CellContext.tsx | 3 +-- reactgrid/package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/reactgrid/lib/components/CellContext.tsx b/reactgrid/lib/components/CellContext.tsx index 2efff140..4a4bada7 100644 --- a/reactgrid/lib/components/CellContext.tsx +++ b/reactgrid/lib/components/CellContext.tsx @@ -1,7 +1,6 @@ import { createContext, memo, useContext } from "react"; import { Cell, CellContextType } from "../types/PublicModel"; import { StickyOffsets } from "../types/InternalModel"; -import { deepCompare } from "../utils/deepCompare"; interface CellContextProviderProps { rowIndex: number; @@ -79,7 +78,7 @@ export const CellContextProvider = memo( (prev, next) => { return ( !next.shouldRenderReorderedCells && - deepCompare(prev.cell, next.cell) && + prev.cell === next.cell && prev.isSelected === next.isSelected && prev.isFocused === next.isFocused && prev.getCellOffset === next.getCellOffset diff --git a/reactgrid/package.json b/reactgrid/package.json index ba966e7c..33b87ccb 100644 --- a/reactgrid/package.json +++ b/reactgrid/package.json @@ -1,6 +1,6 @@ { "name": "@silevis/reactgrid", - "version": "5.0.0-alpha.10", + "version": "5.0.0-alpha.11", "type": "module", "main": "dist/main.js", "types": "dist/main.d.ts",