React native beginner index.android.js is not showing

大兔子大兔子 提交于 2019-12-23 09:10:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!