diff --git a/package.json b/package.json index cd0ee3b..ab82526 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-fluid-table", - "version": "1.1.0", + "version": "1.1.1", "description": "A React table inspired by @tanstack/react-virtual", "author": "Mckervin Ceme ", "license": "MIT", @@ -93,7 +93,7 @@ }, "dependencies": { "@tanstack/react-virtual": "^3.11.1", - "react-resize-detector": "^11.0.1" + "react-resize-detector": "^12.0.1" }, "volta": { "node": "18.18.0", diff --git a/src/Table.tsx b/src/Table.tsx index c4755e6..4ae378e 100644 --- a/src/Table.tsx +++ b/src/Table.tsx @@ -67,7 +67,7 @@ const Table = forwardRef(function ( maxTableHeight={maxHeight} headerHeight={headerHeight} footerHeight={footerHeight} - hasFooter={!!footerComponent || !!columns.find(c => !!c.footer)} + hasFooter={!!footerComponent || columns.some(c => !!c.footer)} > {({ height, width }) => { return ( diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 5490d4a..313c798 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -53,7 +53,7 @@ function Footer({ const ref = useRef(null); // constants - const hasFooter = !!Component || !!columns.find(c => !!c.footer); + const hasFooter = !!Component || columns.some(c => !!c.footer); const style: React.CSSProperties = { minWidth: sticky ? undefined : pixelWidths.reduce((pv, c) => pv + c, 0), ...footerStyle @@ -109,7 +109,7 @@ function Footer({ // render if (!Component) { - const hasFooter = !!columns.find(c => !!c.footer); + const hasFooter = columns.some(c => !!c.footer); return (