You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(data-table): SSR fallback removal, loading prop, and formatFilterValue API
Remove the SSR hydration gate (useIsClient) and make the store always
available during SSR. Table instance is deferred to after hydration via
a tableReady state gate, with null-safe selector hooks throughout.
- Remove useIsClient hook and SSR fallback rendering
- Add useTableInstanceOrNull for null-safe table access during SSR
- Refactor ClientProvider into outer (store) + inner (table) components
- Extract useClientTable and useServerTable hooks from providers
- Add loading prop to DataTable.Client for consumer-controlled skeleton state
- Add columnCount to store so Content derives skeleton columns from columns.length
- Fix loading effect ordering to prevent empty-message flash
- Refactor formatFilterValue from function to Record<string, (value) => string>
with dot-notation support
- Remove dead setTable from store interface
- Deprecate useTableInstance with accurate hydration error message
- Update docs, storybook, and tests for all changes
For paginated API data (e.g., Kubernetes resources with continuation tokens). Like the client mode, pass all options as props directly to `DataTable.Server`:
|`clearAllLabel`|`string`|`"Clear all"`| Label for the clear-all action |
401
401
|`className`|`string`| -- | Root container class |
@@ -552,9 +552,9 @@ All options are passed as props directly to the provider component. The provider
552
552
|`searchableColumns`|`string[]`| -- | Data paths to search in. Supports dot notation (e.g. `['metadata.name', 'spec.email']`) |
553
553
|`searchFn`|`(row, search) => boolean`| -- | Custom search function |
554
554
|`filterFns`|`Record<string, (cellValue, filterValue) => boolean>`| -- | Custom filter functions per column. Keys are data paths |
555
+
|`loading`|`boolean`| -- | Consumer-controlled loading state. When `true`, `DataTable.Content` shows skeleton rows instead of the empty message |
555
556
|`stateAdapter`|`StateAdapter`| -- | URL state sync adapter |
556
557
|`className`|`string`| -- | Class for the provider wrapper div |
557
-
|`ssrFallback`|`ReactNode \| null`|`<DataTable.Loading>`| Rendered during SSR and first client paint. Defaults to a skeleton table matching column count. Set to `null` to render nothing |
558
558
|`children`|`ReactNode`| -- | Table content |
559
559
560
560
### `DataTable.Server` Props
@@ -571,22 +571,21 @@ All options are passed as props directly to the provider component. The provider
571
571
|`defaultFilters`|`FilterValue`|`{}`| Initial filter state |
572
572
|`stateAdapter`|`StateAdapter`| -- | URL state sync adapter |
573
573
|`className`|`string`| -- | Class for the provider wrapper div |
574
-
|`ssrFallback`|`ReactNode \| null`|`<DataTable.Loading>`| Rendered during SSR and first client paint. Defaults to a skeleton table matching column count. Set to `null` to render nothing |
575
574
|`children`|`ReactNode`| -- | Table content |
576
575
577
576
### `DataTable` Namespace
578
577
579
578
| Component | Description |
580
579
|-----------|-------------|
581
-
|`DataTable.Client`| Client-mode provider — pass `data`, `columns`, and all options as props. SSR-safe with automatic skeleton fallback|
582
-
|`DataTable.Server`| Server-mode provider — pass `columns`, `fetchFn`, `transform`, and all options as props. SSR-safe with automatic skeleton fallback|
|`DataTable.Client`| Client-mode provider — pass `data`, `columns`, and all options as props. Accepts `loading` prop for consumer-controlled skeleton state|
581
+
|`DataTable.Server`| Server-mode provider — pass `columns`, `fetchFn`, `transform`, and all options as props. Manages loading state internally via fetch lifecycle|
582
+
|`DataTable.Content`| Table rendering with header, body, empty state, and skeleton loading. Shows skeleton rows (matching `pageSize` and column count) when loading. Accepts sub-element className props (`tableClassName`, `headerClassName`, `headerRowClassName`, `headerCellClassName`, `bodyClassName`, `rowClassName`, `cellClassName`) |
|`DataTable.RowActions`| Per-row action dropdown from `ActionItem[]`|
588
587
|`DataTable.BulkActions`| Render prop for selected rows |
589
-
|`DataTable.Loading`|Skeleton loading state|
588
+
|`DataTable.Loading`|Standalone skeleton table. Use for custom loading layouts outside `DataTable.Content`|
590
589
|`DataTable.InlineContent`| Render custom content inline within the table body. Supports `position` (`"top"` or `"row"`), `open`, `onClose`, and `rowId` props |
591
590
|`DataTable.SelectFilter`| Combobox popover filter with single-select. Accepts `searchable` and `disabled` props |
592
591
|`DataTable.CheckboxFilter`| Multi-value checkbox popover filter with badges and clear button. Accepts `disabled` prop |
0 commit comments