Bootstrapping
Starter kits for React Native
Start a Tamagui app from a template with the native and web tooling already connected.
Templates
There are five starter templates:
- Next + Expo - A production-ready monorepo with Expo Router, Solito, and Next.js.
- Remix - Remix with Vite.
- Takeout Free, Takeout Pro, and Takeout Pro Classic - Takeout starters, with the paid tiers more robust and supported.
Usage
yarn
npm
bun
pnpm
Check out the source of the templates.
A big shout out to Fernando Rojo for creating Solito, a great library for sharing all your views between Expo and Next.js, and the bootstrap repo we borrowed from.
Starting out
The starter-free app requires yarn to run.
To run the app:
Terminal
Included packages (starter-free)
tamaguifor cross-platform views, themes and animationssolitofor cross-platform navigationexpo-routerfor having same routing concepts between web and native- Expo
- Next.js 13
Together they let you build universal apps from one codebase.
Folder layout
-
appsentry points for each appexponext
-
packagesshared packages across appsappyou’ll be importing most files fromapp/features(don’t use ascreensfolder. organize by feature.)provider(all the providers that wrap the app, and some no-ops for Web.)navigationonly for starter-free template, contains the navigation code for RN
You can add other folders inside of packages/ if you know what you’re doing
and have a good reason to.
Start the app
-
Install dependencies:
yarn -
Next.js local dev:
yarn web- Runs
yarn next
- Runs
-
Expo local dev:
yarn native- Runs
expo start
- Runs
Add new dependencies
Pure JS dependencies
If you’re installing a JavaScript-only dependency that will be used across
platforms, install it in packages/app:
Terminal
Native dependencies
If you’re installing a library with any native code, you must install it in
apps/expo:
Terminal
You can also install the native library inside of packages/app if you want to
get autoimport for that package inside of the app folder. However, you need to
be careful and install the exact same version in both packages. If the
versions mismatch at all, you’ll potentially get terrible bugs. This is a
classic monorepo issue. I use lerna-update-wizard to help with this (you don’t
need to use Lerna to use that lib).