问题
There is no code. I am creating a project but some files are missing.
Using command react-native init helloworld
project is created, but index.android.js
and index.ios.js
aren't generated or missing, only index.js
is appearing.
回答1:
This is due to a recent update.
New projects have a single entry-point (index.js) from now on (6e99e31) - @fson
This shouldn't cause you any trouble during the compilation or run-time.
回答2:
I faced the same issue. I build a scratch app. After finding solution on many help portals, I finally find file. Its app.js
not index.js
. In app.js you can find ios and android files.
You can find more info here
And if you want to use these files then downgrade your react version. Yeap, downgraded to 0.44.0 and works now. In cause somebody doesn't know how to downgrade react, you need to install: react-native-git-upgrade
回答3:
New react native apps are created with a single index file, therefore we officially support single index file.
Ref link:- https://github.com/wix/react-native-navigation/issues/3040
来源:https://stackoverflow.com/questions/46685380/react-native-beginner-index-android-js-is-not-showing