xxxxxxxxxx
Default comand is not working
=====not working. ===) npx react-native init MyApp --template react-native-template-typescript
==============Use this command to install typescript==================
====) npx --ignore-existing react-native init MyApp --template react-native-template-typescript
xxxxxxxxxx
npx react-native init MyApp --template react-native-template-typescript
xxxxxxxxxx
npx --ignore-existing react-native init MyApp --template react-native-template-typescript
xxxxxxxxxx
yarn add --dev typescript @types/jest @types/react @types/react-native @types/react-test-renderer
# or for npm
npm install --save-dev typescript @types/jest @types/react @types/react-native @types/react-test-renderer
xxxxxxxxxx
yarn add -D typescript @types/jest @types/react @types/react-native @types/react-test-renderer
xxxxxxxxxx
module.exports = {
preset: 'react-native',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node']
};
xxxxxxxxxx
module.exports = { preset: 'react-native', moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node']};
xxxxxxxxxx
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react",
"lib": ["es6"],
"moduleResolution": "node",
"noEmit": true,
"strict": true,
"target": "esnext"
},
"exclude": [
"node_modules",
"babel.config.js",
"metro.config.js",
"jest.config.js"
]
}