본문 바로가기

IT/javascript

[React Native]초기설정

반응형

https://reactnative.dev/docs/environment-setup

 

Setting up the development environment · React Native

This page will help you install and build your first React Native app.

reactnative.dev

 

잘됩니다~!

macOS 의 특이점!

cocoapods 설치시 루비 최소 버전이 2.7 이어서 설치가 필요함!

 

https://cmjunghoon.github.io/posts/Install_Ruby/

 

Ruby 설치 / 업데이트 / 제거 ( MacOS )

macOS는 기본적으로 Ruby가 설치되어 있습니다.

cmjunghoon.github.io

이를 이용해서 루비 업데이트 후 프로젝트 생성하면됨!

 

프로젝트 생성하기 및 실행하기

npx react-native init LearnReactNative
#프로젝트 시작
npm start

 

** 2023-12-17 일 추가

eslint, prettier 가 서로 싸우느라 import 관련이 사라지지 않는다.

추가 패키지를 설치해야 하는데, prettier 가 모듈 2.8로 고정되어 있어서 설치가 안된다.

그러므로

package.json 파일의 prettier 를 ^3.0.0으로 수정해 준다.

npm i -D  eslint-plugin-prettier eslint-config-prettier

로 모듈을 설치한다.

.eslintrc.js 파일에 아래 라인을 추가한다.

plugins: 'prettier',

반응형