Building a Mobile dApp
React Native and Expo integration with @solana/kit and MWA.
Search across all documentation pages
React Native and Expo integration with @solana/kit and MWA.
npx create-solana-dapp@latest my-mobile-dapp
cd my-mobile-dapp && npx expo start --dev-clientWhen to reach for this:
import { useCallback, useState } from "react";
import { Button, Text, View } from "react-native";
import { createSolanaRpc, address } from "@solana/kit";
import { transact } from "@solana-mobile/mobile-wallet-adapter-protocol-web3js";
const rpc = createSolanaRpc("https://api.devnet.solana.com");
export function App() {
const [addr, setAddr] = useState<string | null>(null);
const connect = useCallback(async () => {
await transact(async (wallet) => {
const auth = await wallet.authorize({
cluster: "devnet",
identity: { name: "Demo", uri: "https://example.com", icon: "icon.png" },
});
setAddr(auth.accounts[0].address);
});
}, []);
return (
<View>
<Button title="Connect" onPress={connect} />
{addr && <Text>{addr}</Text>}
</View>
);
}What this demonstrates:
| Alternative | Use When | Don't Use When |
|---|---|---|
| PWA mobile web | Zero install | MWA native UX |
| Flutter SMS SDK | Dart team | React shop |
Providers in client layout.tsx; pages mix server + client components.
Server env only for keypairs; NEXT_PUBLIC_ for RPC URLs.
All examples use @solana/kit, not web3.js v1.
Signing only in client components.
Revalidate on-chain reads carefully - chain is source of truth.
HTTPS endpoints returning Solana Actions JSON.
Separate React Native app with MWA.
Surfpool for integration; mock RPC in unit tests.
Separate env files and program IDs.
Decode simulation logs for user-facing messages.
Stack versions: This page was written for Agave 4.1.1, Solana CLI 3.0.10, Anchor 0.32.1, anchor-lang 0.32.1, Rust 1.91.1, @solana/kit 7.0.0, Surfpool 0.12.0, and LiteSVM 0.6.x.
Reviewed by Chris St. John·Last updated Jul 19, 2026