For instance, on the Facebook and Firebase documentation, it gives sample code but doesn’t say where to place it. Please help!
I hope I am understanding your question correctly, but I think initializing a project via
expo init project-name using the
tabs template will provide some answers:
$ expo init test ? Choose a template: tabs [16:28:18] Extracting project files... [16:28:19] Customizing project... Your project is ready at /test To get started, you can type: cd test expo start $ tree test ./test/ ├── App.js ├── app.json ├── assets │ ├── fonts │ │ └── SpaceMono-Regular.ttf │ └── images │ ├── icon.png │ ├── robot-dev.png │ ├── robot-prod.png │ └── splash.png ├── babel.config.js ├── components │ ├── StyledText.js │ ├── TabBarIcon.js │ └── __tests__ │ └── StyledText-test.js ├── constants │ ├── Colors.js │ └── Layout.js ├── navigation │ ├── AppNavigator.js │ └── MainTabNavigator.js ├── package.json ├── screens │ ├── HomeScreen.js │ ├── LinksScreen.js │ └── SettingsScreen.js └── __tests__ └── App-test.js 9 directories, 20 files
So, you can put your bootstrap logic in
App.js, your React components in
./components, your React Navigation screens in
./screens, and your stack, switch and tab navigator definitions in
If you use Redux, you can put your actions and reducers, in example, in
$ tree store store ├── actions │ ├── actionTypes.js │ ├── auth.js │ └── ui.js ├── createStore.js ├── reducers │ ├── auth.js │ └── ui.js └── utils.js
But in the end, it’s really up to you to decide how exactly to organize your code. Expo is unopinionated.
As @mbezhanov mentioned, Expo is unopinionated so you can determine what flow and structure works best for your project.
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.