A quick template for using Typescipt and Expo with React Native. NOTE: This template does not support native code.
- You will need to have
node
installed.
You will need to run the init
script which will install all the necessary items in order to run the project. This will include all the node modules and cli tools.
At the root project directory level run the following command:
sh ./bin/init.sh
To run the TS codebase, run for desired platform:
For iOS:
yarn start:ios
For Android:
yarn start:android
This template is already setup and includes:
- Testing with Jest
- Precommit Hooks
- Linting and Prettier
A screen is a "route" which will be added to the Stack navigator. Each screen could have its own screens folder. The structure of each folder should be as follows:
index.tsx
presenter.tsx
- The main logic and export of the component.
styled.tsx
- Any internal styled
emotion
components and stylesheets thepresenter.tsx
file may use. - NOTE: Avoid the
react-native/StyleSheet
if possible.
- Any internal styled
Each specific screen
folder should mimic the root level (src
) folder, for any screen-specific needs. For example:
components
: If there are any modular components that are specific to this screen's presenter.