Skip to content

Function: usePlasma()

usePlasma<S, M>(): PlasmaClient<S, M>

Defined in: react/src/context.tsx:43

Grab the client from context. Throws in development if the provider is missing so mis-mounting fails loud rather than silently.

Explicit type parameters recover the schema / mutators types the context erases:

const client = usePlasma<typeof schema, typeof mutators>()

S extends Record<string, AnyTable> = Record<string, AnyTable>

M = any

PlasmaClient<S, M>