11

A React Native boilerplate with minimal configuration

 3 years ago
source link: https://reactnativeexample.com/a-react-native-boilerplate-with-minimal-configuration/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Boilerplate

A React Native boilerplate with minimal configuration

Sep 09, 2021 1 min read

Luna is a React Native boilerplate with minimal configuration so your app can run on Android, IOS and Web cocurrently.

🛸 Usage

⚠️ Please be sure your environment is set up correctly for React Native CLI.
🔗 https://reactnative.dev/docs/environment-setup

npx react-native init MyAppName --template @notorious112/luna

Use the above command to start a new React Native app using this template. After that, all the commands from below are available:

npm run web

Runs the app in the web.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm run start

Start Metro Bundler.

npm run android

Launches the app for Android in debug mode.

npm run ios

Launches the app for IOS in debug mode.

🐛 Debugging

  • React Native CLI

This template only works with the new CLI. Make sure that:

  • your environment is set up correctly for React Native CLI.
  • you have uninstalled the legacy react-native-cli first (npm uninstall -g react-native-cli) for the below command to work. If you wish to not use npx, you can also install the new CLI globally (npm i -g @react-native-community/cli or yarn global add @react-native-community/cli).

If you tried the above and still get the react-native-template-react- native-template-typescript: Not found error, please try adding the --ignore-existing flag to force npx to ignore any locally installed versions of the CLI and use the latest.
Further information can be found here: https://github.com/react-native-community/cli#about

GitHub

https://github.com/Notorious112/luna

Previous Post

React Native basic app using React Query with GraphQL Code generator and Hasura

Subscribe to React Native Example for Android and iOS

Get the latest posts delivered right to your inbox


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK