From 4ed203917c37cdf27f123259367896aa061e2d2f Mon Sep 17 00:00:00 2001 From: Rawi2115 Date: Wed, 26 Aug 2026 14:23:27 +0300 Subject: [PATCH] fix: resolve MantineStyleProp function/array values for table style The table's style prop was built via object-spread of styles?.table, which silently drops function values (functions have no enumerable own properties) and mishandles arrays (spreading an array into an object produces numeric keys, not valid CSS), causing a runtime TypeError when an array was passed. Pass style as an array instead, matching the pattern already used for the root Box, so Mantine's built-in style resolver correctly handles CSSProperties, functions, and arrays per MantineStyleProp. Fixes #835 --- package/DataTable.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/DataTable.tsx b/package/DataTable.tsx index facdd37a..3fb8c68e 100644 --- a/package/DataTable.tsx +++ b/package/DataTable.tsx @@ -321,11 +321,11 @@ export function DataTable({ }, classNames?.table )} - style={{ - ...styles?.table, - ...(dragToggle.isLocked ? { tableLayout: 'fixed' } : null), - ...(dragToggle.tableWidth != null ? { width: `${dragToggle.tableWidth}px` } : null), - }} + style={[ + styles?.table, + dragToggle.isLocked ? { tableLayout: 'fixed' } : undefined, + dragToggle.tableWidth != null ? { width: `${dragToggle.tableWidth}px` } : undefined, + ]} data-striped={(recordsLength && striped) || undefined} data-highlight-on-hover={highlightOnHover || undefined} {...otherProps}