jineecode
RN 새로운 프로젝트 생성하기 본문
1. typescript를 적용해서 RN 프로젝트 생성하기
npx react-native init MyApp --template react-native-template-typescript
1) 설치에 실패했다면?
Removing module react-native-template-template-typescript...
error This module isn't specified in a package.json file.
info Visit https://yarnpkg.com/en/docs/cli/remove for documentation about this command.
warn Failed to clean up template temp files in node_modules/react-native-template-template-typescript. This is not a critical error, you can work on your app.
(node:10378) UnhandledPromiseRejectionWarning: Error: Command failed: yarn add react-native-template-template-typescript
1-1)
npm uninstall -g react-native-cli
npm i -g @react-native-community/cli
react-native-cli를 지우고 react-native-community/cli로 설치.
mac 환경이라면 sudo를 붙혀서 언인스톨 하세요!
npx react-native init MyApp --template react-native-template-typescript
2. typescript가 붙은 styled-component 설치
npm install --save styled-components
npm install --save-dev @types/styled-components
3. redux 설치
npm install redux react-redux --save
4. redux-toolkit 설치
npm install @reduxjs/toolkit
npm i --save-dev @types/react-redux
https://hybridheroes.de/blog/2021-01-08-redux-toolkit-react-native/
참조:
https://soyoung210.github.io/redux-toolkit/tutorials/basic-tutorial
'React native' 카테고리의 다른 글
Warning: [react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system! (0) | 2022.02.09 |
---|---|
React-Navigation 사용법 (0) | 2021.08.10 |
todolist (0) | 2021.07.03 |
AsyncStorage 사용 (0) | 2021.07.03 |
props & state (0) | 2021.07.03 |