Skip to main content

React Native dApp Scaffold

The scaffold is a ready-to-go React Native dApp that offers:

  • Pre-installed standard SDKs like Mobile Wallet Adapter and @solana/web3.js
  • Required polyfills like react-native-get-random-values and Buffer installed.
  • Simple React UI Components like ConnectWalletButton, RequestAirdropButton, SignMessageButton.

Prerequisites

  • React Native and Android Envrionment setup
    • An Android device/emulator.
    • Install an MWA compliant wallet app on your device/emulator.

Usage

  1. Initialize project template.
npx react-native init MySolanaDapp --template @solana-mobile/solana-mobile-dapp-scaffold --npm
note

The --npm flag is only needed if you're using Yarn 2 or 3 as the default package manager. Once the template is initialized, you can delete the package-lock.json and run yarn install to continue using Yarn.

  1. Install dependencies;
  • yarn install
  1. Launch the app on your Android device/emulator.
  • npx react-native run-android