Skip to content

Commit

Permalink
fix: warning when column is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Jul 20, 2021
1 parent 2128b5f commit dd511d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function useTableResizableHeader<ColumnType extends Record<string, any>>(
}, []);

React.useLayoutEffect(() => {
const width = resizableColumns.reduce((total, current) => {
const width = resizableColumns?.reduce((total, current) => {
return total + (Number(current.width) || columns?.[columns.length - 1].width || defaultWidth);
}, 0);
setTableWidth(width);
Expand Down

0 comments on commit dd511d5

Please sign in to comment.