Website Links

Monday 9 January 2017

React Native #1 - Getting Started!

Hi everyone, React Native is a cool framework I've been learning about lately that lets you build mobile apps using Javascript. So over the next few weeks I will document my efforts with developing apps in React Native!

Getting Started

Just follow the React Native Getting Started guide to download everything you require. Note: iOS apps can only be developed on a Mac. I will be developing an app for both Android and iOS over this series so will be using a Mac. If you get errors, you may need to update node/npm if you have previously installed these.

Initialising the App

  1. In your terminal, change to your development directory or where you want your react native project to be saved.
  2. Enter the command
    react-native init [project_name]
    This will setup your React Native project
  3. Enter the command
    cd [project_name]
  4. Enter the command
    react-native run-ios
    from inside your React Native project directory to see the base iOS output
  5. To see the base Android output:
    1. Open the android folder in Android studio
    2. Go to Tools > Android > AVD Manager and setup a device, this will handle installing anything you need for the emulator to run
    3. Run the virtual device you created
    4. Enter the command
      react-native run-android
      from inside your React Native project directory to see the base Android output


Editing the view

You can edit the view displayed in the index.android.js and index.ios.js files in your preferred text editor.

No comments:

Post a Comment