From 30f37c8cca2c6024bb71639b136eebf2b6db8fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lcio=20Franco?= Date: Mon, 3 Jun 2024 17:31:51 -0400 Subject: [PATCH] fix: allow connect mutation to be optional (#100) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After my last PR https://github.com/FuelLabs/fuels-npm-packs/pull/97 exposing `useMutations` options, it started to request arguments on `connect` (but it should be optional). | 📷 Evidence | | --- | | Screenshot 2024-06-03 at 17 21 53 | --- .changeset/small-birds-shop.md | 2 ++ packages/react/src/hooks/useConnect.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .changeset/small-birds-shop.md diff --git a/.changeset/small-birds-shop.md b/.changeset/small-birds-shop.md new file mode 100644 index 00000000..a845151c --- /dev/null +++ b/.changeset/small-birds-shop.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/react/src/hooks/useConnect.ts b/packages/react/src/hooks/useConnect.ts index 0e973460..7d24a27e 100644 --- a/packages/react/src/hooks/useConnect.ts +++ b/packages/react/src/hooks/useConnect.ts @@ -6,7 +6,7 @@ export const useConnect = () => { const { fuel } = useFuel(); const { mutate, mutateAsync, ...mutateProps } = useMutation({ - mutationFn: async (connectorName?: string | null) => { + mutationFn: async (connectorName?: string | null | void) => { if (connectorName) { await fuel.selectConnector(connectorName); }