Skip to content

Commit

Permalink
fix: 比较 dataCfg 使用 Object.is
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Nov 14, 2024
1 parent 4af50b5 commit 2d74602
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/s2-react/src/hooks/useSpreadSheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function useSpreadSheet(props: SheetComponentProps) {
let reloadData = false;
let rebuildDataSet = false;

if (!isEqual(prevDataCfg, dataCfg)) {
if (!Object.is(prevDataCfg, dataCfg)) {
// 列头变化需要重新计算初始叶子节点
if (
prevDataCfg?.fields?.columns?.length !==
Expand All @@ -126,7 +126,7 @@ export function useSpreadSheet(props: SheetComponentProps) {
}

if (!isEqual(prevOptions, options)) {
if (!isEqual(prevOptions?.hierarchyType, options?.hierarchyType)) {
if (prevOptions?.hierarchyType !== options?.hierarchyType) {
rebuildDataSet = true;
reloadData = true;
s2Ref.current?.setDataCfg(dataCfg);
Expand Down

0 comments on commit 2d74602

Please sign in to comment.