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

How can I upgrade the Typescript version used by React Native?

$
0
0

I'm using import type declarations in my React Native code, which works fine with npx tsc and inside of VS Code. But when I run the app, I get Unexpected Token errors.

How can I get React Native to play nicely with import type? It seems to me it must be using an old version of TypeScript but if I knew how to configure that, I don't recall how now.

(I've tried resetting cache, deleting app from simulator and reinstalling, cleaning Xcode build.)

Edit: I'm thinking this may have to do with an old version of @babel/plugin-transform-typescript, which is part of metro-react-native-babel-transformer, which is required by RN's package.json.

enter image description here


Viewing all articles
Browse latest Browse all 6213

Trending Articles



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