You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8
Original file line number
Diff line number
Diff line change
@@ -154,6 +154,14 @@ Alternatively, if you want to use exactly the same transformation code for both
154
154
155
155
Note that there have been no reports of problems arising from differences between code compiled by the `ts-jest` transformer and code compiled by `react-native-typescript-transformer`. Additionally, `ts-jest` takes care of a lot of edge cases and is more configurable.
156
156
157
+
## Avoid cyclical dependencies
158
+
159
+
If you're transitioning an app from `tsc` to `react-native-typescript-transformer`, you might be seeing runtime errors that involve imported modules being `undefined`. You almost certainly have cyclical inter-module dependencies which manifest during your app's initialization. e.g. if ModuleA is `undefined` in ModuleB it means that ModolueA (in)directly imports ModuleB.
160
+
161
+
`tsc` seems to be able to mitigate some instances of these cyclical dependencies when used as a whole-app compiler. Unfortunately the module-at-a-time compilation approach that react-native's bundler supports does not permit the same optimizations.
162
+
163
+
Be especially careful of "umbrella export" files which can easily introduce these cycles.
0 commit comments