Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/yellow-streets-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@reown/appkit-react-native': patch
'@reown/appkit-ui-react-native': patch
'@reown/appkit-bitcoin-react-native': patch
'@reown/appkit-coinbase-react-native': patch
'@reown/appkit-common-react-native': patch
'@reown/appkit-core-react-native': patch
'@reown/appkit-ethers-react-native': patch
'@reown/appkit-solana-react-native': patch
'@reown/appkit-wagmi-react-native': patch
---

fix: useAccount hook now returns empty array if appkit is not connected
4 changes: 3 additions & 1 deletion packages/appkit/src/hooks/useAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export function useAccount() {
} = useSnapshot(ConnectionsController.state);

const allAccounts: Account[] = useMemo(() => {
if (!address) return [];

return Array.from(connections.values()).flatMap(
_connection =>
_connection.accounts
Expand All @@ -97,7 +99,7 @@ export function useAccount() {
})
.filter(account => account !== undefined) as Account[]
);
}, [connections]);
}, [connections, address]);

const activeChain = useMemo(
() =>
Expand Down