React Native Template / Boilerplate
Bleeding 🔪 Edge 🌉 Nightlymare 🌃 Edition
““”̿ ̿ ̿ ̿ ̿’̿’̵͇̿̿з=(*▽*)=ε/̵͇̿̿/̿ ̿ ̿ ̿ ̿’““
IDKFA
[![NPM RN pkg ver](https://img.shields.io/badge/React%20Native-0.71.12-red.svg)](https://github.com/facebook/react-native/releases)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](#)
[![Linter](https://badges.aleen42.com/src/eslint.svg)](#)
[![Formatter: prettier](https://img.shields.io/badge/Formatter-Prettier-f8bc45.svg)](#)
[![CI](https://github.com/leotm/react-native-template-new-architecture/actions/workflows/main.yml/badge.svg)](https://github.com/leotm/react-native-template-new-architecture/actions/workflows/main.yml)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/leotm/react-native-template-new-architecture/pulse)
[![Docs](https://img.shields.io/badge/Docs%3F-yes-green.svg)](https://github.com/leotm/react-native-template-new-architecture/wiki)
[![Project](https://img.shields.io/badge/Proj%3F-yes-green.svg)](https://github.com/leotm/react-native-template-new-architecture/projects/1)
Android |
iOS |
|
|
Setup
Fresh M1/M2
Yarn v4
Upgrading from v1 classic
or v3 latest
/ berry
/ stable
cd ~
yarn set version canary
Clear generated files
Install
yarn # 🍺 version
yarn setup # 🤖 versioned version
Start
yarn start
Silicon (M1/M2) Macs
iOS (arm64)
cd ios
pod install
..
yarn ios
_Old Rosetta 2 Intel x86_64 way_
Android
NDK
_Old manual setup
_
[Building-from-source#prerequisites](https://github.com/facebook/react-native/wiki/Building-from-source#prerequisites), but with NDK 25.0.8775105
```
# android/local.properties
sdk.dir=/Users//Library/Android/sdk
ndk.dir=/Users//Library/Android/sdk/ndk/25.0.8775105
```
_Strip: ` rcX` suffix / (trailing) spaces / final final linebreak - otherwise `fcntl(): Bad file descriptor`_
Fat M1 components: ndk-build, LLVM, CMake, Make, Python, Ninja, shader-tools, simpleperf - yasm remaining
Android Studio
_Old manual setup
_
Open [Android Studio - Preview release - Canary build](https://developer.android.com/studio/preview)
- Open Project, set the [JDK](https://github.com/leotm/react-native-template-new-architecture/wiki/Android#jdk)
- [SDK Manager > SDK Tools > NDK > ⬇️ 25.0.8775105](https://user-images.githubusercontent.com/1881059/158474758-c8c1412c-2f35-4d0d-abc7-6ba18c65827c.png)
- Build [all 4 default ABIs](https://github.com/leotm/react-native-template-new-architecture/blob/master/android/gradle.properties#L33) first with other libraries
- Open an arm64 AVD e.g. `Pixel_3a_API_31_arm64-v8a` [Initial Preview v3: Google APIs System Image](https://github.com/google/android-emulator-m1-preview)
- Make Project
Run
yarn android
Troubleshooting
Storybook v6
Add stories to src/components/**/*.stories.(ts|tsx)
_Keep in sync with .storybook
and storybook_server
/main.js
_
yarn get-stories
yarn storybook-server # optional
https://github.com/leotm/react-native-template-new-architecture/blob/01f1c9864f55367004effbe26d3f33590784704b/src/index.tsx#L132
_Old v5 setup
_
https://github.com/leotm/react-native-template-new-architecture/blob/01f1c9864f55367004effbe26d3f33590784704b/metro.config.js#L16
- https://github.com/facebook/hermes/issues/135
- https://github.com/facebook/react-native/issues/31969
```sh
# @storybook/react-native-server v5
yarn storybook
```
```sh
yarn
```
Node
With ts-node and curveball
yarn server
Deno
brew install deno
yarn deno