React native beginner index.android.js is not show

2019-06-22 04:20发布

问题:

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 github

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