본문 바로가기

react

Create Expo + ReactNative + Typescript Manually I can make Expo + ReactNative + Typescript via below script easily.]$ create-react-native-app {{APP_NAME}} --scripts-version=react-native-scripts-tsBut, Sometimes I need setup typescript manually.Here the solution !]$ yarn add -D typescript tslib @types/react @types/react-native @types/expoWrite App.js file below..import AppContainer from "./src/AppContainer"; export default AppContainer;Make sr.. 더보기
Create ReactNative + Typescript App project ]$ yarn global add create-react-native-app]$ create-react-native-app {{APP_NAME}} --scripts-version=react-native-scripts-tsReactJS 웹프로젝트 생성해주듯이 Native 용 프로그램인 create-react-native-app을 설치해준다. 이해 해당 cli를 이용하여 --scripts-version=react-native-scripts-ts 옵션을 줘서 프로젝트를 생성해준다.생성해준 후 기존 expo 환경에서의 개발이 편하다면 scripts들에 명령들을 생성해주어 기존 CRNA를 통해 작업했을 때와 동일하게 작업이 가능하다. "scripts": { "start": "expo start", "eject":.. 더보기
typescript + react project via parcel Parcel Bundler를 이용하여 typescript + reaact 프로젝트를 설정해 볼 예정이다.먼저 필요 패키지들을 설치해준다. yarn add react react-domyarn add -D parcel-bundler yarn add -D @types/react @types/react-dom많이 들 하듯이 package.json 파일내에 script를 추가해준다. "scripts": { "dev": "parcel ./src/index.html", "build": "parcel build ./src/index.html" }src 폴더를 만들어 주고 index.html 파일을 만들어 준다.DOCTYPE html> Parcel Example index.tsx 파일도 생성해준다.import React.. 더보기