Skip to content

React Native

Billy Bunn edited this page May 14, 2019 · 1 revision

Getting Started

There's a great tool called Expo that offers a super easy way to start building things in React Native. They have a CLI that offers the equivalent of 'create-react-app' for React Native applications.

  • Install expo globally: npm install -g expo-cli
  • Create a new project: expo init AwesomeProject
  • Navigate to that project folder: cd AwesomeProject
  • Start the project: npm start
    • you can also use: expo start

React vs. React Native

A React Native component will mostly look like a regular old React component—but there are some important differences.

You'll still see class and functional component syntax in JSX, but we won't be rendering HTML anymore—HTML is used for the DOM, something that exists on an actual website. In a React Native app—something meant to be rendered on the screen of a phone or tablet device, we'll be rendering XML. The docs put it best:

Many frameworks use a special templating language which lets you embed code inside markup language. In React, this is reversed. JSX lets you write your markup language inside code. It looks like HTML on the web, except instead of web things like <div> or <span>, you use React components.