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.