Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
Table API Reference
Column API Reference
Row API Reference
Cell API Reference
Header API Reference
Features API Reference
Static Functions API Reference
Legacy API Reference

table_syncExternalStateToBaseAtoms

ts
function table_syncExternalStateToBaseAtoms<TFeatures, TData>(
   table,
   capturedState?,
   compare?): void;
function table_syncExternalStateToBaseAtoms<TFeatures, TData>(
   table,
   capturedState?,
   compare?): void;

Defined in: core/table/coreTablesFeature.utils.ts:28

Synchronizes externally controlled state slices into the table's base atoms.

This keeps options.state values mirrored in the atom graph so derived atoms, stores, and table APIs read a consistent snapshot.

Adapters that update options during their host's render phase pass the state snapshot captured by the committed render as capturedState — the shared options object may already hold values from a newer render that never commits. Pass null to publish nothing (a captured "no controlled state"); omitting the argument reads the current table.options.state instead. An optional compare suppresses semantically unchanged slice writes; the default remains reference equality.

Type Parameters

TFeatures

TFeatures extends TableFeatures

TData

TData extends RowData

Parameters

table

Table_Internal<TFeatures, TData>

capturedState?

| Partial<TableState<TFeatures>> | null

compare?

(currentState, externalState) => boolean

Returns

void

Example

ts
table_syncExternalStateToBaseAtoms(table)
table_syncExternalStateToBaseAtoms(table, capturedState ?? null, shallow)
table_syncExternalStateToBaseAtoms(table)
table_syncExternalStateToBaseAtoms(table, capturedState ?? null, shallow)