Appearance
Documentation / expo / isConnected
Function: isConnected()
isConnected(s)
isConnected(
s
):s is EmbeddedWalletConnectedState
A type predicate to narrow the Embedded Wallet state to the Connected state.
Parameters
• s: EmbeddedWalletState
Returns
s is EmbeddedWalletConnectedState
Example
ts
import {useEmbeddedWallet, useEmbeddedSolanaWalet, isConnected} from '@privy-io/expo';
const wallet = useEmbeddedWallet();
/// OR
const wallet = useEmbeddedSolanaWallet();
{isConnected(wallet) && (
<button onClick={() => signMessage(wallet.provider)}>
Sign Message
</button>
)}
isConnected(s)
isConnected(
s
):s is EmbeddedSolanaWalletConnectedState
A type predicate to narrow the Embedded Wallet state to the Connected state.
Parameters
• s: EmbeddedSolanaWalletState
Returns
s is EmbeddedSolanaWalletConnectedState
Example
ts
import {useEmbeddedWallet, useEmbeddedSolanaWalet, isConnected} from '@privy-io/expo';
const wallet = useEmbeddedWallet();
/// OR
const wallet = useEmbeddedSolanaWallet();
{isConnected(wallet) && (
<button onClick={() => signMessage(wallet.provider)}>
Sign Message
</button>
)}