diff --git a/.changeset/green-mayflies-dance.md b/.changeset/green-mayflies-dance.md new file mode 100644 index 00000000..322e94c6 --- /dev/null +++ b/.changeset/green-mayflies-dance.md @@ -0,0 +1,5 @@ +--- +"@reactive-dot/react": minor +--- + +BREAKING: nested tx options to avoid possible property clash. diff --git a/packages/react/src/hooks/use-mutation.ts b/packages/react/src/hooks/use-mutation.ts index ac093bf2..37444b4c 100644 --- a/packages/react/src/hooks/use-mutation.ts +++ b/packages/react/src/hooks/use-mutation.ts @@ -65,8 +65,9 @@ export function useMutation< ( get, _set, - submitOptions?: TxOptions> & { + submitOptions?: { signer?: PolkadotSigner; + txOptions?: TxOptions>; }, ) => { const signer = @@ -87,7 +88,10 @@ export function useMutation< mutationEventSubject.next({ ...eventProps, value: pending }); return transaction - .signSubmitAndWatch(signer, submitOptions ?? options?.txOptions) + .signSubmitAndWatch( + signer, + submitOptions?.txOptions ?? options?.txOptions, + ) .pipe( tap((value) => mutationEventSubject.next({ ...eventProps, value }),