Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Typescript does not fail on type mismatch

$
0
0

I use tsx in my react native app.Why doesn't my app fail or even log type mismatch to console when I write this code

const MainScreenSelect: FunctionComponent<{ }> = function ({  }) {    let a:number=12;    a="hello";    console.log(a)    return <View></View>}

here is my tsconfig.json

{"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"    ]  }```

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>