react native expo 파일 생성 및 환경설정

fejigu·2023년 2월 3일
1

React Native

목록 보기
1/11
post-thumbnail

🔎 파일 생성 및 환경 설정 정리

👉🏻 회사 프로젝트에 앞서 금주부터 시작한 react native 학습, 아직 파일 생성 및 환경 설정이 익숙치 않아 프로젝트를 생성하며 진행한 과정을 기록하며, 익숙해지고자 한다.

npx create-expo-app 파일명
npm install -g create-expo-app

cd 파일명
rm -rf .git
npm install @react-navigation/native
npx expo install react-native-screens react-native-safe-area-context
npm install react-native-screens react-native-safe-area-context
npm i prop-types
npx eslint --init
//eslint 설정
code . 

//eslint plugin 설정
"plugin:react/jsx-runtime"
//react hooks plugin 설정
npm install eslint-plugin-react-hooks --save-dev
//react hooks plugin 설정
"plugin:react-hooks/recommended"
//.prettierrc 파일 생성 및 설정
{
    "singleQuote": true,
    "arrowParens": "always",
    "tabWidth": 2,
    "printWidth": 80
}
//src 폴더 생성
//App.js 파일 생성
//기존 root 경로에 있던 App.js에 있던 코드를 새로 생성한 App.js에 붙여넣기
//기존 root 경로에 있던 App.js는 아래와 같이 수정
import App from "./src/App";
export default App;
//component 사용을 할 것이니 미리 설치
npm i prop-types
//앱 실행하기
npm start
//ios 화면 열기
i

profile
console.log(frontendjigu( ☕️, 📱); // true

0개의 댓글