Skip to content
IC Reactor

useActorMethod

useActorMethod<Service, Method, Transform>(__namedParameters): UseReactorMethodResult<Service, Method, Transform>

Defined in: react/src/hooks/useActorMethod.ts:180

A unified hook for calling canister methods that automatically handles both query and mutation methods based on the Candid interface.

Service = BaseActor

Method extends string = FunctionName<Service>

Transform extends keyof TransformArgsRegistry<unknown> = "candid"

UseReactorMethodParameters<Service, Method, Transform>

UseReactorMethodResult<Service, Method, Transform>