A starter repo for iOS and Android with a Navigator, TabBar, and MobX store for app state.
$ git clone [email protected]:constelation/native-starter.git <YOUR_REPO_NAME>
$ cd <YOUR_REPO_NAME>
$ ./rename.sh <YourProjectName> # this script will rename your project from NativeStarter
$ git remote set-url origin <YOUR_NEWLY_CREATED_GIT_REPO_URL>
$ npm install$ npm run build:dev # Start tsc in watch mode to convert .ts -> babel
$ npm start # Start react-native packager server, which serves up the js bundle to the emulators
$ npm run xcode # Open xcode for the projectClick on Play button (cmd+r) to run the app on the ios Simulator
You will need a maximum of 3 terminal tabs/windows to run the React Native packager, Android Virtual Devices, and view the Android logs
$ npm run build:dev
$ npm start
$ npm run android-emulator # Open the android emulator manager- Select the Emulator that you've already created (from the Getting Started steps)
- Click Start...
- Click Launch
$ npm run android # Deploy the app to the already running emulator and hook in to its logsPlease consult the React Playbook
- Be sure to enable live reload if you want your file changes to immediately reload the app
- YellowBox is disabled. See
index.android.jsandindex.ios.jsto re-enable it if you'd like.
.
├── /android/ # android-specific code (bootstrapped from `react-native init`)
├── /ios/ # ios-specific code (bootstrapped from `react-native init`)
|
├── /assets
│ ├── /fonts/
│ ├── /images/
│ └── /videos/
|
├── /app # Your app-specific source code of the application
│ ├── /store/ # Responsible for you app state. Houses MobX actions and observables
│ ├── /scenes/ # Components that are handled by a Navigator. Same as pages, views, etc for the app.
│ | ├── /App/ # Root scene
│ | ├── /_/ # Subcomponents of App
│ | └── /App.js # Component used in index.ios.js
│ ├── /shared/ # Shared components used in 2+ scenes
│ └── /utils/ # **Optional** Helper js functions that are app and/or model aware
|
├── /lib # Your non-app-specific Components and functions
|
├── /node_modules/ # 3rd-party libraries and utilities
└── package.json # The list of 3rd party libraries and utilities
npm start-start react packagernpm run ios- starts iOS simulatornpm run xcode- launch XCodenpm run android-emulator- launch Android Virtual Device Manager (to start emulator)npm run android- run app on emulator and show logs in terminalnpm run reinstall- wipe outnode_modules, resetwatchman, then installnode_modulesagainnpm run upgrade-react-native upgrade, thenreact-native link
Typescript, React Native and Sourcemaps - React Native at Microsoft
- Talk to @kylpo