In React Native, you can access the primary wallet through the dynamicClient.wallets.primary property. This gives you direct access to the main wallet associated with the user.
React Native
import { useReactiveClient } from '@dynamic-labs/react-hooks';import { dynamicClient } from '<path to client file>';const { wallets } = useReactiveClient(dynamicClient);// wallets.primary -> primary wallet// wallets.userWallets -> array of user wallets
Add extra logic during any wallet connection (walletConnected)
React Native uses the walletConnected event (equivalent to handleConnectedWallet in the React SDK) to add logic during wallet connection events.
React Native
const dynamicClient = createClient({ environmentId: '<env id>',});dynamicClient.wallets.setHandler('walletConnected', (wallet) => { console.log("walletConnected was called", wallet); // if runYourOwnLogic return true, the connection will be established, otherwise it will not return runYourOwnLogic();});