Skip to content
IC Reactor

ReactorProviderProps

Defined in: react/src/index.tsx:250

Props of ReactorProvider.

readonly client: () => Client

Defined in: react/src/index.tsx:267

Returns the client of this tree. Either it creates one, such as () => createClient({ network: "ic", auth: () => new AuthClient() }), and the provider owns that client and disposes it when it unmounts; or it returns a client the app created before, at module scope, as () => client, and the provider borrows it and never disposes it.

A factory, not a client, so that the provider decides when it runs: once per mounted provider, never per render. Give it no work beyond creating or returning the client (createClient does none until the client is used): React may call it twice in development and keep one result.

Only the factory of the first render is used. A different function on a later render does not rebuild the client; to replace it, remount the provider by giving it another key.

Client


readonly children: ReactNode

Defined in: react/src/index.tsx:269

The tree that reads the client with useClient and useAuth.