Open TuurDutoit opened 4 months ago
Thanks for the report @TuurDutoit - you're right, this is supported at build time and shouldn't be flagged.
I'm not a TS expert but reading the docs it looks like preserve
will ultimately be the best option for us given we do our own bundling, but it's TS 5.4 only and the community template is still on 5.0.
In the mean time, bumping module
(not lib
) to es2020
looks safe to me (we support import.meta
syntax, at least), and we'd take a PR for that. WDYT @NickGerleman?
@robhogan that makes sense to me! Or maybe esnext
, which assumes everything should be available (rely on the bundler to catch anything unsupported).
I am also facing this issue. Any resolution for this?
same question.May be shoule update tsconfig.
Description
@react-native/typescript-config
sets"module": "es2015"
(source). As the error suggests, this value does not allow using dynamic imports (import("module")
). The React Native runtime does support them, however.Steps to reproduce
yarn android
yarn tsc
App.tsx
I created this from the basic Expo Snack template (SDK 51), to which I added TypeScript and a dynamic import.
React Native Version
0.74.3
Affected Platforms
Other (please specify)
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/TuurDutoit/react-native-typescript-dynamic-import
Screenshots and Videos
No response