React Native 앱 생성하기

DG
2 min readFeb 16, 2020

--

  1. NodeJS를 설치한다.
  2. Command line tool을 설치한다.
sudo npm install expo-cli --global

3. expo 프로젝트를 생성한다

expo init my-new-project
cd my-new-project
expo start

참고로 저는 blank — typescript 버전으로 프로젝트를 생성해주었습니다.

그러면 expo 페이지가 나오게 됩니다.

Run on IOS simulator 버튼을 클릭하여서 시뮬레이터를 돌릴 수 있습니다.

그리고 React Native는 styled-components와 사용하면 궁합이 매우 좋습니다. (제가 평소에 styled-components)를 사용해서 그런걸지도…

yarn add styled-componentsimport React from 'react';
import styled from 'styled-components';
const Container = styled.View`
flex: 1;
background-color: papayawhip;
justify-content: center;
align-items: center;
`;
const Message = styled.Text`
font-size: 20px;
font-weight: 500;
color: palevioletred;
`;
export default function App() {
return (
<Container>
<Message>
React Native with 💅 Styled Components
</Message>
</Container>
);
}

--

--

DG
DG

Written by DG

한국의 iOS 개발자이다. 강아지와 운동을 좋아함. github: https://github.com/donggyushin

No responses yet