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
React-native now uses a single index.js, instead of index.android.js and index.ios.js. Conditionals like if (SriPlatform.isAndroid) produces different code for android:dev and ios:dev tasks.
This makes it hard to use a single file index.js. It should produce the same code, like when using if (ReactPlatform.OS == "android")
The text was updated successfully, but these errors were encountered:
Apps created via create-react-native do indeed have only a single index.js. I felt that we had a choice to go down that route or not and so far have chosen not to. CRNA switched to a single index.js by changing the relevant ios/ and android/ code. However, we should decide to go down a path that makes sense for us. Continuing with separate files past when CRNA switched was just convenient when I was dealing with this issue.
aside: Do note that we MUST also support react-native-web going forward (working on an example project that supports all 3 targets in a single code base).
Going forward, happy to revisit. Could you enumerate the benefit of combining into a single index.js?
React-native now uses a single
index.js
, instead ofindex.android.js
andindex.ios.js
. Conditionals likeif (SriPlatform.isAndroid)
produces different code forandroid:dev
andios:dev
tasks.This makes it hard to use a single file
index.js
. It should produce the same code, like when usingif (ReactPlatform.OS == "android")
The text was updated successfully, but these errors were encountered: