ReactJS to React Native
Start wrAfter two years doing web stuff in ReactJS, I have been itching to do a production ready React Native App.
Finally, a client asked, “You did React before, right?”
Me: “Yea”
Client: “Then React native shouldn’t be a problem?”
Me: “Yea, it should be quite similar”
Haha, I was so naive…
Here is a list of things that I wish I knew going from ReactJS to React Native
Although it’s jsx syntax, you’re not in web development world anymore
StyleSheet is similar, but not the same as CSS. There’s no global styles if it’s not imported.
Even if I want to do something like Text { color: white; }
, I can’t…yet. (wink. wink. Facebook developers)
Remember to connect your device and your laptop to the same wifi if you’re using remote debugger.
“Responsive” Design take a lot more effort than defining media query
Think about big phone, little phone, portrait and landscape view.
Elie has a great implementation.
Or if you want a library solution.
Third party module can only take you so far
Move on to the next third party modules if one is not working, because react native changes fast. Some third party modules are just outdated.
Some companies only provide SDK in Object-C or Swift. Hope there’s a nice person who would write a wrapper for you, or have fun learning another language.
Learn to bridge native module
Live reload/Hot reload won’t save time from compiling native code
Remove unused modules when experimenting fails, or your life will be spent waiting for Xcode to compile
Be prepared for Build Failed, so before you link some new library commit your previous changes
rm -rf node_module && yarn i && cmd + K to clean build cache solves 80% of the problem
Read more on Medium