# UseReactorMethodParameters

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

Configuration for useActorMethod hook.
Extends react-query's QueryObserverOptions with custom reactor params.

This is a unified hook that handles both query and mutation methods.
Query-specific options (like refetchInterval) only apply to query methods.
Mutation-specific options (like invalidateQueries) only apply to mutation methods.

## Extends

- `Omit`\<`QueryObserverOptions`\<[`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\>, [`ReactorReturnErr`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnerr/)\<`Service`, `Method`, `Transform`\>, [`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\>, [`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\>, `QueryKey`\>, `"queryKey"` \| `"queryFn"`\>

## Type Parameters

### Service

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

### Method

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

### Transform

`Transform` *extends* [`TransformKey`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/transformkey/) = `"candid"`

## Properties

### reactor

> **reactor**: [`Reactor`](https://ic-reactor.b3pay.net/v3/libs/classes/reactor/)\<`Service`, `Transform`\>

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

The reactor instance to use for method calls

***

### functionName

> **functionName**: `Method`

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

The method name to call on the canister

***

### args?

> `optional` **args?**: [`ReactorArgs`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorargs/)\<`Service`, `Method`, `Transform`\>

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

Arguments to pass to the method (optional for parameterless methods)

***

### callConfig?

> `optional` **callConfig?**: `CallConfig`

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

Agent call configuration (effectiveCanisterId, etc.)

***

### queryKey?

> `optional` **queryKey?**: readonly `unknown`[]

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

Custom query key (auto-generated if not provided)

***

### onSuccess?

> `optional` **onSuccess?**: (`data`) => `void`

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

Callback when the method call succeeds.
Works for both query and mutation methods.

A method's `undefined` result arrives as `null`, as in `useActorQuery`,
for query and update methods alike.

#### Parameters

##### data

[`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\>

#### Returns

`void`

***

### onError?

> `optional` **onError?**: (`error`) => `void`

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

Callback when the method call fails.
Works for both query and mutation methods.

#### Parameters

##### error

[`ReactorReturnErr`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnerr/)\<`Service`, `Method`, `Transform`\>

#### Returns

`void`

***

### invalidateQueries?

> `optional` **invalidateQueries?**: readonly `unknown`[][]

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

Query keys to invalidate after a successful mutation.
Only applies to mutation methods (updates).