Search code examples
javascriptandroidreact-nativeexpo

App.js file not being created inside project foldeer using Expo


I'm a newbie to React Native and am using this tutorial to learn it. I used Expo to set up my project folder to develop an Android application. The tutorial, at 19:39, instructs you to edit the App.js file. No such file exists in the project folder I set up.

I found this, which notes that apparently App.js has been "replaced with _layout.tsx, but also index.tsx to some degree".

Where am I supposed to edit the code which is equivalent to writing it in App.js as in the tutorial, though? The following is a screenshot of my project folder:

Screenshot of project root in VSCode


Solution

  • This video is more than a year old, and probably the lib you used to init the project already got a new update that changed something showed on the video. Better follow the official docs for the step-by-step instead, and only come for (recent) videos for specific issues.

    The first difference that I see is that the tutorial is in Javascript (.js files), but your print showed Typescript files (.ts / .tsx), suggesting you used a different --template flag to init the project.

    npx create-expo-app YOUR-PROJECT-NAME --template blank should do the trick.

    Also, they don't seem to be using Expo, like you said you are.

    Check out how to create your first app with Expo here: https://docs.expo.dev/tutorial/create-your-first-app/

    Good luck!