function Subscribe<TSourceValue>(props): ComponentChildren;function Subscribe<TSourceValue>(props): ComponentChildren;Defined in: Subscribe.ts:101
A Preact component that allows you to subscribe to 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>
ComponentChildren
<Subscribe
source={table.store}
selector={(state) => ({ rowSelection: state.rowSelection })}
>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</Subscribe><Subscribe
source={table.store}
selector={(state) => ({ rowSelection: state.rowSelection })}
>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</Subscribe><Subscribe
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection[row.id]}
>
{(selected) => <input checked={!!selected} type="checkbox" />}
</Subscribe><Subscribe
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection[row.id]}
>
{(selected) => <input checked={!!selected} type="checkbox" />}
</Subscribe>function Subscribe<TSourceValue, TSelected>(props): ComponentChildren;function Subscribe<TSourceValue, TSelected>(props): ComponentChildren;Defined in: Subscribe.ts:104
A Preact component that allows you to subscribe to 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>
ComponentChildren
<Subscribe
source={table.store}
selector={(state) => ({ rowSelection: state.rowSelection })}
>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</Subscribe><Subscribe
source={table.store}
selector={(state) => ({ rowSelection: state.rowSelection })}
>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</Subscribe><Subscribe
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection[row.id]}
>
{(selected) => <input checked={!!selected} type="checkbox" />}
</Subscribe><Subscribe
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection[row.id]}
>
{(selected) => <input checked={!!selected} type="checkbox" />}
</Subscribe>function Subscribe<TFeatures, TSelected>(props): ComponentChildren;function Subscribe<TFeatures, TSelected>(props): ComponentChildren;Defined in: Subscribe.ts:107
A Preact component that allows you to subscribe to 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>
ComponentChildren
<Subscribe
source={table.store}
selector={(state) => ({ rowSelection: state.rowSelection })}
>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</Subscribe><Subscribe
source={table.store}
selector={(state) => ({ rowSelection: state.rowSelection })}
>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
</Subscribe><Subscribe
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection[row.id]}
>
{(selected) => <input checked={!!selected} type="checkbox" />}
</Subscribe><Subscribe
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection[row.id]}
>
{(selected) => <input checked={!!selected} type="checkbox" />}
</Subscribe>