So I was super excited to start using React Native, it’s been a while since I tried building an iOS app and because I haven’t used Objective-C in a while, I really haven’t had any motivation to build any of the ideas I have had. Then enter React Native and the dream that all the speed and ease of building React apps on the web would be ported to building mobile iOS apps. So as soon as I had free time (which is rare) I started going through the Getting Started guide. Even the Getting Started guide was fast and easy. Got everything downloaded and everything seemed to be working, I was able to create a new project and open it up in Xcode and it built perfectly. But then I made some text changes – my personal favorite is always to add “Hello World” to any app – and then I tried the reload feature by clicking cmd+R in the simulator… wait… nothing… try again… still nothing. That’s weird, everything up until now has been easy and just worked. So I closed the simulator, and tried to rebuild… still not showing my changes… okay, maybe something isn’t being build, I’ll just close down Xcode… bring back Xcode… rebuild.. still nothing… okay, maybe there was something weird with my project, let me blow it away and recreate it… okay, now rebuild… still nothing… getting a little frustrated… let’s just say I decided to walk away and came back a while later… and looking through the GitHub issues for React Native, I found the following:
Cmd-R not refreshing? Everything loads up fine, example are are running smoothly, but if I make a change in the JS file and hit Cmd-R in the simulator, nothing happens. Did I forget something?
And after going through the thread and trying a few things suggested, I noticed a terminal window that was running in the background:
I also notice that there was a problem with the packager and it wasn’t could initialize. So I kill the process and try again… still nothing… so I decide to try the good old Windows solution and reboot my machine… wait for it… it worked (thanks Microsoft for conditioning me to always do this). So it seems Watchman was in a weird state and wouldn’t actually run, so I had to reboot the machine to get it un-weird. There was probably a way to do it without rebooting my machine, but rebooting was quick and worked. Anyways, I hope this helps someone out there – good luck and happy hacking with React Native.