Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,17 @@ export const useMRT_TableInstance = <TData extends MRT_RowData>(
showColumnFilters,
showGlobalFilter,
showToolbarDropZone,
// The controlled-only loading slices have no internal state — they only ever
// arrive via `options.state` — so they must be re-injected here too, or every
// component reads `isLoading: undefined` and e.g. body cells render real Cells
// over the blank skeleton rows instead of <Skeleton>s.
isLoading: statefulTableOptions.state.isLoading ?? false,
isSaving: statefulTableOptions.state.isSaving ?? false,
showLoadingOverlay: statefulTableOptions.state.showLoadingOverlay ?? false,
showProgressBars: statefulTableOptions.state.showProgressBars ?? false,
// not defaulted: `false` means "suppress skeletons even while loading"
// (MRT_TableBodyCell checks `showSkeletons !== false`), undefined means "auto"
showSkeletons: statefulTableOptions.state.showSkeletons!,
Comment on lines +402 to +404

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Align the exported showSkeletons type with the intentional undefined value.

examples/react/mantine-react-table/src/mantine-react-table/types.ts:424-446 declares MRT_TableState.showSkeletons as boolean, but Line 404 returns undefined when the option is not controlled. The non-null assertion only suppresses the TypeScript check; it does not change the runtime value. Update the type to boolean | undefined and remove !. Keep the value un-defaulted because MRT_TableBodyCell.tsx:202-209 distinguishes undefined from explicit false.

Suggested type alignment
--- a/examples/react/mantine-react-table/src/mantine-react-table/types.ts
+++ b/examples/react/mantine-react-table/src/mantine-react-table/types.ts
@@
-    showSkeletons: boolean
+    showSkeletons: boolean | undefined

--- a/examples/react/mantine-react-table/src/mantine-react-table/hooks/useMRT_TableInstance.ts
+++ b/examples/react/mantine-react-table/src/mantine-react-table/hooks/useMRT_TableInstance.ts
@@
-    showSkeletons: statefulTableOptions.state.showSkeletons!,
+    showSkeletons: statefulTableOptions.state.showSkeletons,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// not defaulted: `false` means "suppress skeletons even while loading"
// (MRT_TableBodyCell checks `showSkeletons !== false`), undefined means "auto"
showSkeletons: statefulTableOptions.state.showSkeletons!,
// not defaulted: `false` means "suppress skeletons even while loading"
// (MRT_TableBodyCell checks `showSkeletons !== false`), undefined means "auto"
showSkeletons: statefulTableOptions.state.showSkeletons,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@examples/react/mantine-react-table/src/mantine-react-table/hooks/useMRT_TableInstance.ts`
around lines 402 - 404, Update MRT_TableState.showSkeletons in types.ts to
boolean | undefined, then remove the non-null assertion from
statefulTableOptions.state.showSkeletons in useMRT_TableInstance. Preserve the
un-defaulted value so undefined remains distinct from explicit false.

}

// v8-style `getState()` alias for any consumer that still calls it.
Expand Down