function Subscribe<TSourceValue>(props): ReactNode | Promise<ReactNode>;function Subscribe<TSourceValue>(props): ReactNode | Promise<ReactNode>;Defined in: Subscribe.ts:125
A React component that allows you to subscribe to the table state.
This is useful for opting into state re-renders for specific parts of the table state.
For table.Subscribe from useTable, prefer that API — it uses overloads so JSX contextual typing works. This standalone component uses a union props type.
TSourceValue
SubscribePropsWithSourceIdentity<TSourceValue>
ReactNode | Promise<ReactNode>
// As a standalone component — full store
<Subscribe source={table.store} selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</Subscribe>// As a standalone component — full store
<Subscribe source={table.store} selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</Subscribe>// Entire source (atom or store) — no selector
<Subscribe source={table.atoms.rowSelection}>
{(rowSelection) => <div>...</div>}
</Subscribe>// Entire source (atom or store) — no selector
<Subscribe source={table.atoms.rowSelection}>
{(rowSelection) => <div>...</div>}
</Subscribe>// Project source value (e.g. one row’s selection)
<Subscribe
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection?.[row.id]}
>
{(selected) => <tr data-selected={!!selected}>...</tr>}
</Subscribe>// Project source value (e.g. one row’s selection)
<Subscribe
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection?.[row.id]}
>
{(selected) => <tr data-selected={!!selected}>...</tr>}
</Subscribe>// As table.Subscribe (table instance method)
<table.Subscribe selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</table.Subscribe>// As table.Subscribe (table instance method)
<table.Subscribe selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</table.Subscribe>function Subscribe<TSourceValue, TSelected>(props): ReactNode | Promise<ReactNode>;function Subscribe<TSourceValue, TSelected>(props): ReactNode | Promise<ReactNode>;Defined in: Subscribe.ts:128
A React component that allows you to subscribe to the table state.
This is useful for opting into state re-renders for specific parts of the table state.
For table.Subscribe from useTable, prefer that API — it uses overloads so JSX contextual typing works. This standalone component uses a union props type.
TSourceValue
TSelected
SubscribePropsWithSourceWithSelector<TSourceValue, TSelected>
ReactNode | Promise<ReactNode>
// As a standalone component — full store
<Subscribe source={table.store} selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</Subscribe>// As a standalone component — full store
<Subscribe source={table.store} selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</Subscribe>// Entire source (atom or store) — no selector
<Subscribe source={table.atoms.rowSelection}>
{(rowSelection) => <div>...</div>}
</Subscribe>// Entire source (atom or store) — no selector
<Subscribe source={table.atoms.rowSelection}>
{(rowSelection) => <div>...</div>}
</Subscribe>// Project source value (e.g. one row’s selection)
<Subscribe
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection?.[row.id]}
>
{(selected) => <tr data-selected={!!selected}>...</tr>}
</Subscribe>// Project source value (e.g. one row’s selection)
<Subscribe
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection?.[row.id]}
>
{(selected) => <tr data-selected={!!selected}>...</tr>}
</Subscribe>// As table.Subscribe (table instance method)
<table.Subscribe selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</table.Subscribe>// As table.Subscribe (table instance method)
<table.Subscribe selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</table.Subscribe>function Subscribe<TFeatures, TSelected>(props): ReactNode | Promise<ReactNode>;function Subscribe<TFeatures, TSelected>(props): ReactNode | Promise<ReactNode>;Defined in: Subscribe.ts:131
A React component that allows you to subscribe to the table state.
This is useful for opting into state re-renders for specific parts of the table state.
For table.Subscribe from useTable, prefer that API — it uses overloads so JSX contextual typing works. This standalone component uses a union props type.
TFeatures extends TableFeatures
TSelected
SubscribePropsWithStore<TFeatures, TSelected>
ReactNode | Promise<ReactNode>
// As a standalone component — full store
<Subscribe source={table.store} selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</Subscribe>// As a standalone component — full store
<Subscribe source={table.store} selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</Subscribe>// Entire source (atom or store) — no selector
<Subscribe source={table.atoms.rowSelection}>
{(rowSelection) => <div>...</div>}
</Subscribe>// Entire source (atom or store) — no selector
<Subscribe source={table.atoms.rowSelection}>
{(rowSelection) => <div>...</div>}
</Subscribe>// Project source value (e.g. one row’s selection)
<Subscribe
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection?.[row.id]}
>
{(selected) => <tr data-selected={!!selected}>...</tr>}
</Subscribe>// Project source value (e.g. one row’s selection)
<Subscribe
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection?.[row.id]}
>
{(selected) => <tr data-selected={!!selected}>...</tr>}
</Subscribe>// As table.Subscribe (table instance method)
<table.Subscribe selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</table.Subscribe>// As table.Subscribe (table instance method)
<table.Subscribe selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</table.Subscribe>