초기 설정 및 디펜던시 설치

Column
Tags
settings

설치 (종속성도 포함)

 

패키지 설치

#작업하고 있는 react-native 패키지 폴더로 이동해서 설치해야함. (프로젝트가 바뀌면 매번 다시 설치) #npm을 쓰고 있다면 $ npm install @react-navigation/native #yarn을 쓰고 있다면 $ yarn add @react-navigation/native
 

종속성 설치 (dependencies)

Expo 프로젝트일 경우

$ expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
 

React Native 프로젝트일 경우

#npm을 쓰고 있다면 $ npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view #yarn을 쓰고 있다면 $ yarn add react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
RN 0.6.0 이상부터는 자동으로 링킹까지 해주므로 react-native link는 할 필요 없다.
 
#Mac에서 ios까지 같이 개발중이라면 링킹 완료를 위해 아래 명령어도 ㄱㄱ $ npx pod-install ios
 

*****필수***** (react-native-gesture-handler)

//이제 index.js 혹은 App.js의 최상단에 아래와 같이 적어주면 된다. //반드시 최상단에 적어야함 (위에 아무것도 없이) //생략하면 개발 시에는 정상동작 할 지라도, production에서 crash가 나므로 중요!! import 'react-native-gesture-handler';