Coder Social home page Coder Social logo

react-native-demo's Introduction

Advanced React-Native Boiler Plate

React Native React Navigation V3 js-eslint-style

  • This is an extension of the ignite react-native boiler plate. It uses eslint-recommended and utilizes Ignite

  • This is an advanced boilerplate which uses react-native, redux-saga, redux-persist, apisauce. It will be a very useful to kickstart your project if you are using these frameworks/librarirs. Or want to have some strict linting style.

  • We have used react-native-extended-stylesheet in this project. Since every mobile application should be responsive even if we don't use flex-layout for all the styling in the application. Instead of using the StyleSheet provided by react-native, we recommend using the stylesheet provided by this library.

Removed modules/libraries from the original ignite react-native boiler plate

⬆️ How to Setup

Step 1: git clone this repo:

Step 2: cd to the cloned repo:

Step 3: Rename the project bundleId, package name and application name.

Step 4: Install the Application with npm i

▶️ How to Run App

  1. cd to the repo
  2. Run Build for either OS
  • for iOS
    • run npm run ios
  • for Android
    • run npm run android
    • Use the sdk versions for any third party library you add as mentioned in Project/android/app/build.gradle. Since google forces to use target sdk 26 or onwards.

Eslint Compliant

This project adheres to "eslint:recommended" style guide. We have setup and enabled eslint for this project. We suggest that you keep following it. There are pre-commit hooks implemented to prevent bad commits. So if you don't lint your code before commititng it, you won't be able to commit it.

To Lint

This is implemented using eslint. Just run npm run lint

To Fix Lint Errors

run npm run fixcode

Bypass Lint And Run Project

If you have to bypass lint and just run the project for special case.

  • for iOS
    • run react-native run-ios
  • for Android
    • run react-native run-android

Understanding Linting Errors

The linting rules are from airbnb and React-Standard. Regular JS errors can be found with descriptions here, while React errors and descriptions can be found here. Airbnb errors can be found here. We have customised the linting as per our requirements. You can check the .eslintrc of the project and modify it as per your requirements.

🔐 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!

react-native-demo's People

Contributors

simform-solutions avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.