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

.tsx files throw errors while .js files work fine

$
0
0

in react-native, when I try to pass parameters to functions/components/etc, typescript files will always complain and it won't work until I have specified the type which often is confusing and the code looks way more like spaghetti..

When using .js file with the same code, everything works fine. Also, there are no errors shown in VSCode when there are missing imports or wrong types being passed. Is there any proper way to handle this? Should I only use .tsx for react-native ? can I somehow get a sweet-spot between having errors with .tsx files and not having any Intellisense with .js files?

Btw: I dont need help fixing the errors in the pictures, I want to avoid that they're being shown as errors.

Thanks in Advance.passing parameters errorexample error


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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