Create-react-native-app: There is no index.js in app file!

Created on 31 Jan 2018  路  6Comments  路  Source: expo/create-react-native-app

Description

After create-react-native-app app2, I got lots of files without# # index.js in my project root file.Is this a bug?
image

reate-react-native-app version: 1.0.0

npm 4.0.0

Most helpful comment

It appears if you eject.

Before ejection the scripts know about your folder structure and will use App.js.

All 6 comments

It appears if you eject.

Before ejection the scripts know about your folder structure and will use App.js.

See package.json and app.json for how your app is configured and how it points to App.js, which is intentionally the entry point component of the project.

I solved!
Declaration of App is in package.json
./node_modules/react-native-scripts/build/bin/crna-entry.js

There, you can see App's default location which

var _App = require('../../../../App');

Then you can change it. I put it App.js in a src folder than it looks like this

var _App = require('../../../../src/App');

@cyb3rsalih worked for me, thanks!

image

For anyone coming across this: you shouldn't change files in node_modules, since they'll get overwritten when you update the package.

which i can do ? I want to hasve index.js

Was this page helpful?
0 / 5 - 0 ratings