Expo CLI vs React Native CLI

Expo CLI

기본적으로 내장하고 있는 패키지가 많아서 앱의 빌드 크기가 큼

React Native CLI

React Native만 설치되어 있고, 필요한 패키지들은 설치해야 함

EAS와 다르게 빌드를 직접 해야함

제한없는 3rd party 라이브러리 사용 가능

기본 Command

프로젝트 생성

react-native init [ProjectName] --template templateName 

—template 옵션을 이용해 typescript 프로젝트 생성 가능

앱 실행

react-native run-ios
react-native run-android

Metro Bundler 실행

Metro Bundler는 Webpack과 비슷하게 JavaScript 파일들을 하나의 파일로 번들링해주는 역할을 한다.

react-native start
react-native start -- --reset-cache

코드를 수정했음에도 정상 동작하지 않는 경우 Metro Bundler의 cache가 남아있을 수 있는데 —reset-cache 옵션으로 캐시 삭제 가능

로그 확인

react-native log-ios 
react-native log-android

설치

Setting up the development environment · React Native

Homebrew