Refactor folder structure - add πππ folder
Part ΙͺΙͺ: React-Native UIβStory 05: Refactor folder structure - add πππ folder
GIT : Repo
| Feature/Story branch
| PR
In the previous posts, we initialized react-native project and then configured ESLint/Prettier for code linting and formatting. In this post, we would quickly refactor the default scaffolded folder structure to add a src
folder under which we would maintain our source code.
Enable Live Reloading of our app on simulator
Before we start making changes to our code, lets first enable hot reloading on the simulator. (Live reload vs Hot Reload)
(For Android simulator, the React-Native Developer menu can be brought up by clicking anywhere on the simulator and pressing βcmd + Mβ buttons.)
πππ folder
We will keep all our source files under src
folder except index.js
:
- Open project in your code editor
- Create a folder
src
under the projectβs root folder - Move the file
App.js
from root folder to the above createsrc
folder - In
index.js
, update the path for import for App and save the fileπ
Edit App.js
a little bit just to make sure our app still running good after we moved the file to new src
folder. Hot reloading should refresh the app on the simulator reflecting the changes made in App.js
.π
Nice, now we have the src
folder where we would add all code files/subfolders.
In the next post, we would add Google Sign-In to our appβs iOS platform.
β Prev:ESLint/Prettier
βπ
β Next:User Sign-in Component
β