Manging React Native File Structure
Hey everyone!
This is a very short, additional post, after watching video 4 in Hitesh's React Native 101 series. I am so thankful to Hashnode for sponsoring the series as it's super helpful!
There are 2 big takeaways from this video, for me:
1) Don't be afraid of all the folders and files that appear when you create a new React Native project. All that setup is handled in Hitesh's first 3 videos in the series.
The folders and files are mostly 'irrelevant' at the moment. You won't have to even look at most of them for the time being. Dealing with dependencies and versioning of those dependencies is a more advanced skill, I imagine. The only one to be aware of is the file that we actually edit in order to change the app: App.tsx.
The other big point for me is about the node_modules folder: it is totally fine to delete this folder, even by accident. If it happens for any reason, you can reinstall all the project dependencies by running npm install from the terminal.
But here's the caveat: don't run npm install anywhere except inside the project folder. If you're not sure where you are, you can run pwd to see the working directory (your current location). If you run it anywhere else, you can end up changing your system badly.
I DID THIS ONCE AND HAD TO COMPLETELY UNINSTALL AND REINSTALL NODE AND NPM BEFORE IT ALL WORKED CORRECTLY AGAIN. TAKE CARE WITH THIS!
Subscribe to my newsletter
Read articles from Jonathan Hobdell directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Jonathan Hobdell
Jonathan Hobdell
Former helpdesk support technician turned frontend developer, currently learning React, Vue and MERN / MEVN.