Skip to content
A Expo Typescript Template for React Native
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets Initial Commit Jan 1, 2019
bin
src Initial Commit Jan 1, 2019
.gitignore
.prettierrc
.watchmanconfig
App.tsx
README.md Initial Commit Jan 1, 2019
app.json Initial Commit Jan 1, 2019
babel.config.tsx Initial Commit Jan 1, 2019
package.json
rn-cli.config.js
tsconfig.json
tslint.json Initial Commit Jan 1, 2019
yarn.lock Initial Commit Jan 1, 2019

README.md

Expo Typescript Template

A quick template for using Typescipt and Expo with React Native. NOTE: This template does not support native code.

Table of Contents

Prerequisites and Setup

Before You Get Started

  1. You will need to have node installed.

Project Setup Steps

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:

npm run init

Running The Project

To run the TS codebase, run for desired platform:

For iOS:

yarn start:ios

For Android:

yarn start:android

Structure

Features

This template is already setup and includes:

  • Testing with Jest
  • Precommit Hooks
  • Linting and Prettier

Screens

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:

  1. index.tsx
  2. presenter.tsx
    • The main logic and export of the component.
  3. styled.tsx
    • Any internal styled glamorous components and stylesheets the presenter.tsx file may use.
    • NOTE: Avoid the react-native/StyleSheet if possible.

Nested Folders:

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.
You can’t perform that action at this time.