2023-06-19 04:44:51 +00:00
# react native app setup (not using Expo)
2023-06-20 06:50:25 +00:00
# REACT NATIVE CLI QUICKSTART (NOT EXPO GO) QUICKSTART
# follow setup guide for each specific platform (iOS or Android) and OS (Linux, Windows, MacOS): [https://reactnative.dev/docs/environment-setup](https://reactnative.dev/docs/environment-setup "setup")
2023-06-19 04:44:51 +00:00
2023-06-20 06:50:25 +00:00
- make sure you have node and npm installed
2023-06-19 04:44:51 +00:00
- cd to directory where you want this app to be installed
2023-06-20 06:50:25 +00:00
- create app (already accomplished, keeping for notes):
2023-06-19 04:44:51 +00:00
2023-06-20 06:50:25 +00:00
`npx react-native@latest init SelahReactNativeApp`
2023-06-19 04:44:51 +00:00
- select yes for installing react-native packages
2023-06-20 06:50:25 +00:00
NOTE: in VS Code some of the created files might show errors and complain about not being able to detect the `babel.config.js` file. Add this to your settings.json file in VS Code (Open command pallete: View-> Command Pallete or Ctrl+Shift-P and type "settings"):
2023-06-19 04:44:51 +00:00
```
"eslint.workingDirectories": [
{"mode": "auto"}
]
```
2023-06-20 06:50:25 +00:00
Run the app (Android emulator)
- make sure your android emulator is running (running API 33 tiramisu per the react-native setup docs)
- start Metro which is a js bundler that ships with react native. cd into react-native app directory and run:
`npx react-native start`
select yes to install react-native packages
- let metro run in its own terminal. Open a new terminal to start the app in an android device:
`npx react-native run-android`
NOTE: if you get a `error: unknown command 'run-android'` try this command
`npm install --save react-native`
and try again:
`npx react-native run-android`
2023-06-19 04:44:51 +00:00
2023-06-20 06:50:25 +00:00
You should have a running react-native app in Android!
2023-06-19 04:44:51 +00:00
2023-06-20 06:50:25 +00:00
TODO: mac/iOS local setup...