From 480bdd3c52f0d7ad9c1619dd781d26144ba87f83 Mon Sep 17 00:00:00 2001 From: hemengke <23536175@qq.com> Date: Mon, 26 Jul 2021 11:38:03 +0800 Subject: [PATCH] fix: no render when columns prop is not reactive --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 065d869..5926619 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -6,7 +6,7 @@ function useTableResizableHeader>( /** @description 最后一列不能拖动,设置最后一列的最小展示宽度 */ defaultWidth: number = 120, ) { - const [resizableColumns, setResizableColumns] = React.useState([]); + const [resizableColumns, setResizableColumns] = React.useState(columns || []); const [tableWidth, setTableWidth] = React.useState();