Skip to content

mcgomez/react-native-boilerplate

Repository files navigation

Cuttlesoft Boilerplate

JavaScript Style Guide

Build Status

  • Standard compliant React Native App Utilizing Ignite

◀️ Prerequisites

⬆️ Quick Start

# Install dependencies with `yarn`
yarn install

# Build and run for iOS
react-native run-ios

# Build and run for Android
react-native run-android

# Run standalone dev tools
react-devtools

▶️ Advanced

Once the application is running, you can press '⌘D' in the simulator to open the debug menu. From here, you can access:

  • Remote JS Debugging
  • Live reload
  • Hot Reloading
  • ... and more!

iOS: Specifying a device

You can specify the device the simulator should run with the --simulator flag, followed by the device name as a string. The default is "iPhone 6". For exampel, if you wish to run your app on an iPhone 4s, just run react-native run-ios --simulator="iPhone 4s".

The device names correspond to the list of devices available in Xcode. You can check your available devices by running xcrun simctl list devices from the console.

🚫 Standard Compliant

This project adheres to Standard. Our CI enforces this, so we suggest you enable linting and auto-formatting to keep your project compliant during development.

Understanding Linting Errors

The linting rules are from JS Standard and React-Standard. Regular JS errors can be found with descriptions here, while React errors and descriptions can be found here.

🔐 Secrets

This project uses react-native-config to expose config variables to your javascript code in React Native. You can store API keys and other sensitive information in a .env file:

API_URL=https://myapi.com
GOOGLE_MAPS_API_KEY=abcdefgh

and access them from React Native like so:

import Secrets from 'react-native-config'

Secrets.API_URL // 'https://myapi.com'
Secrets.GOOGLE_MAPS_API_KEY // 'abcdefgh'

The .env file is ignored by git keeping those secrets out of your repo.

Get started

  1. Copy .env.example to .env
  2. Add your config variables
  3. Follow instructions at https://github.com/luggit/react-native-config#setup
  4. Done!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published