[react-native] How to fix leftover non-updating application states

I'm not sure why but while exploring react-native, I've found out that sometimes the changes to the source code do not automatically reflect the code within the mobile app itself during development like it should. During such cases, it's best to clean and rebuild everything from scratch:

  • Clear out watchman cache by running, watchman watch-del-all
  • In the IOS simulator uninstall the app by going to home (Command + Shift + H), holding down on the app icon and clicking x. Install the app again by running react-native run-ios.
  • To clean packager cache, run ./node_modules/react-native/packager/packager.sh --reset-cache. You might want to copy that to one of your npm run scripts.