jineecode

RN 새로운 프로젝트 생성하기 본문

React native

RN 새로운 프로젝트 생성하기

지니코딩 2021. 7. 10. 12:31

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/

 

Using Redux Toolkit in React Native: Getting started and usage guide

Redux Toolkit is an official package from the Redux Team that helps configuring Redux store and reduces boilerplate. It also includes many convenience features that help supercharge your state management. Using Redux Toolkit in React Native is straightforw

hybridheroes.de

 

 

참조:

https://soyoung210.github.io/redux-toolkit/tutorials/basic-tutorial

 

Comments