Skip to content

Instantly share code, notes, and snippets.

@minlaxz
Last active May 23, 2021 19:39
Show Gist options
  • Save minlaxz/ac3c3e73cc9b0f210d98f37b2fe710ae to your computer and use it in GitHub Desktop.
Save minlaxz/ac3c3e73cc9b0f210d98f37b2fe710ae to your computer and use it in GitHub Desktop.
Developing React native app with `Expo` CLI.

Developing React native app with Expo CLI.

  • To get started, install expo -> npm install -g expo-cli
  • Login Expo with expo login
  • Generate a test app with expo init MyApp
  • Edit App.js file and start project with expo start This will start up Metro Server in your development machine.
  • To start and run on android expo start --android.

Deploying to GitHub Pages:

Deploy React App to Github-Pages

  • git init

  • git remote add origin git@github.com:username/repo.git

  • yarn add -D gh-pages

  • Update package.json

"homepage": `"http://username.github.io/repo" "scripts": { ... "deploy": "gh-pages -d web-build", "predeploy": "expo build:web" }

  • yarn deploy predeploy is automatically run before deploy.

Deploy React to Firebase Hosting

  • When asked about the public path, make sure to specify the web-build folder.
  • Answer 'Configure as a single-page app (rewrite all urls to /index.html)' with 'Yes'.
  • Update package.json "scripts": { ... "predeploy": "expo build:web", "deploy-hosting": "npm run predeploy && firebase deploy --only hosting", }

Ref

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment