react native typescript template 라는 서드 파티 라이브러리가 있어서 편하게 사용했지만
앞으로는 리액트 네이티브와 타입스크립트를 각각 설치하는 방향으로 가는 편이 좋겠다
버전 이슈를 매번 대응해야 하는 점이 서드 파티의 치명적인 단점 같음..
npx react-native init [프로젝트 폴더 명]
npm install typescript @types/react @types/react-native --save-dev
위와 같이 두 번 나누어 설치하는 편이 건강에 이롭다
tsconfig.json 설정
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react",
"lib": ["es6", "es2017"],
"moduleResolution": "node",
"noEmit": true,
"strict": true,
"target": "esnext",
"skipLibCheck": true
},
"exclude": ["node_modules", "babel.config.js", "metro.config.js", "jest.config.js"]
}