React Native - 401-advanced-javascript-v/seattle-javascript-401d29 GitHub Wiki
npm install -g expo-cli
expo init AwesomeProject
cd AwesomeProject
npm start # you can also use: expo start
import React, { Component } from 'react';
import { Text, View } from 'react-native';
export default class HelloWorldApp extends Component {
render() {
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<Text>Hello, world!</Text>
</View>
);
}
}
The other unusual thing in this code example is Hello world!. This is JSX - a syntax for embedding XML within JavaScript.
<Text> is a built-in component that just displays some text and View is like the <div> or <span>.