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.
Type Parameters
Section titled “Type Parameters”Service
Section titled “Service”Service = BaseActor
Method
Section titled “Method”Method extends string = FunctionName<Service>
Transform
Section titled “Transform”Transform extends keyof TransformArgsRegistry<unknown> = "candid"
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”UseReactorMethodParameters<Service, Method, Transform>
Returns
Section titled “Returns”UseReactorMethodResult<Service, Method, Transform>