Skip to content

withReactApi

withReactApi<TSchema>(store): Store<TSchema, { }> & ReactApi

Defined in: packages/@livestore/react/src/useStore.ts:23

Augments a Store instance with React-specific methods (useQuery, useClientDocument).

This is called automatically by useStore() and LiveStoreProvider. You typically don’t need to call it directly unless you’re building custom integrations.

TSchema extends LiveStoreSchema<DbSchema, EventDefRecord>

Store<TSchema>

Store<TSchema, { }> & ReactApi

// Usually not needed—useStore() does this automatically
const store = withReactApi(myStore)
const todos = store.useQuery(tables.todos.all())