• Stars
    star
    328
  • Rank 128,352 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

React Native Web CLI

SWUbanner

Warning: Project is not actively maintained

React Native Web CLI

create-react-native-web-app

NPM

GitHub issues license GitHub top language npm

A simple CLI tool to start your React Native Web project to develop same app for IOS Android and Web

Compatibility: React Native >= 0.63.

Installation

# Run create-react-native-web-app <project-directory>
$ npx crnwa myApp
# or
$ npx create-react-native-web-app myApp

# if you previously installed this package globaly run this command first to uninstall the previous version:
# npm uninstall -g create-react-native-web-app

# cd into your <project-directory>
$ cd myApp

# Run Web/Ios/Android development
# Web
$ npm run web

# IOS
$ npm run ios

# Android
$ npm run android

Folder structure

myApp
β”œβ”€β”€ android (When opening with Android studio, open this folder)
β”‚   └── android project files
β”œβ”€β”€ ios (When opening with Xcode, open this folder)
β”‚   └── ios project files
β”œβ”€β”€ public
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ index.html
β”‚   └── manifest.json
└── src
    └── project code

Testing

# Web and Native
$ npm run test

# Web
$ npm run test:web

# Native
$ npm run test:native

Debugging

Open dev menu:

  1. CMD+D (IOS) / CMD+M (Android)
  2. Press "Enable Live-Reload"

React native docs - debugging real devices guide

React native docs - debugging guide

Network calls in the devtools

Build

# Web
$ npm run build

# Android - upgrade the current build version in `android/app/build.gradle` file (both the `versionCode` and the `versionName`)
Example:
versionCode 2
versionName "1.1"

# And then run the build
$ cd android && ./gradlew assembleRelease

# Open apk folder to find the release apk
$ open ./android/app/build/outputs/apk

React native docs - Android signed apk

React native docs for IOS

Resources