# useActorMethod

> **useActorMethod**\<`Service`, `Method`, `Transform`\>(`__namedParameters`): [`UseReactorMethodResult`](https://ic-reactor.b3pay.net/v3/libs/interfaces/usereactormethodresult/)\<`Service`, `Method`, `Transform`\>

Defined in: [react/src/hooks/useActorMethod.ts:180](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L180)

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

## Type Parameters

### Service

`Service` = [`BaseActor`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/baseactor/)

### Method

`Method` *extends* `string` = [`FunctionName`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/functionname/)\<`Service`\>

### Transform

`Transform` *extends* keyof [`TransformArgsRegistry`](https://ic-reactor.b3pay.net/v3/libs/interfaces/transformargsregistry/)\<`unknown`\> = `"candid"`

## Parameters

### \_\_namedParameters

[`UseReactorMethodParameters`](https://ic-reactor.b3pay.net/v3/libs/interfaces/usereactormethodparameters/)\<`Service`, `Method`, `Transform`\>

## Returns

[`UseReactorMethodResult`](https://ic-reactor.b3pay.net/v3/libs/interfaces/usereactormethodresult/)\<`Service`, `Method`, `Transform`\>