fix: columns are regenerated if the user runs the query again

This commit is contained in:
Kavin Venkatachalam 2025-04-04 11:19:06 +05:30
parent c500f9f584
commit 8e528f391c

View file

@ -69,7 +69,8 @@ export const Table = memo(
}, [id, actions, setTableActions]);
useEffect(() => {
if (useDynamicColumn || !isEqual(prevFirstRowOfTable, firstRowOfTable)) shouldAutogenerateColumns.current = true;
if (useDynamicColumn || (!isEqual(prevFirstRowOfTable, firstRowOfTable) && !isEmpty(firstRowOfTable)))
shouldAutogenerateColumns.current = true;
}, [firstRowOfTable, useDynamicColumn, columnData, prevFirstRowOfTable]);
// Set column details to the table store. This is responsible for auto-generating columns