0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

React Native + Expo で一瞬で作るHello Worldアプリ

Last updated at Posted at 2021-08-01

React Native
https://reactnative.dev/docs/getting-started

Expo
https://docs.expo.dev/get-started/installation/

前提

Nodeが入ってること

作る

expo CLIをダウンロードする

$ yarn global add expo-cli

expo CLIでプロジェクトを作る。

$ expo init AwesomeProject

プロジェクトのディレクトリに移動して

$ cd AwesomeProject

App.jsの<Text>タグ内をHello World !に編集する

import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

export default function App() {
  return (
    <View style={styles.container}>
      <Text>Hello World !</Text>
      <StatusBar style="auto" />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

サーバー起動

$ yarn start

expo startでもOK

Android端末 か iOS端末で Expo Goをストアからインストールする

さっき起動したターミナルか起動した時に開いたブラウザページのQRコードをExpo Goで読み取る

終わり。

感想

すごい簡単じゃん

Expo は全てのAndroid / iOSのAPIが使えるわけではなかったり、その他にも制限はあるみたいなので、使う前に読んでおいたほうがいいね
https://docs.expo.dev/introduction/why-not-expo/?redirected

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?