My hard time with React Native (Part 1)
To be honest, learning a new programming language is a hassle. Especially with anyone who found themselves to be a lazy person like me and I’m not exactly the kind of guy that can patiently read through all the documents about React Native (To be clear, when you set up React Native environment it’s best to follow the document, it’s clear and precise enough for starter).
This part focus on explaining concepts and questioning things that I am found it curious and want to be known when I got my hand on React Native. This part does not contain coding guide. I’ll try to make it short and focus and what (I think) need to be known.
What is React Native?
- It’s a view — In the core, Facebook inflate everything on a view and execute command in that view with javascript.
- It use Reactjs syntax.
- It’s purely javascript.
- Facebook made it. (Which is, in my opinion a crucial decision weight for anyone who want to learn new things. I would totally feel safe when use a language that is developed by an enormous company)
Through a lot of guides, they mention a programming language called “Native” what is it?
Well, this is embarrassing since English is not my mother language. It took me a couple of hours to figure it out. But, I think it’s something that worth explaining :’) “Native” here imply java (or kotlin) in android development and swift (or objective-c) in ios development.
What is the cons and pros between React Native and “Native”?
- React Native can be coded only one time to use on both android and ios devices
- You can live update react native code when a bug is found in a blink of an eye without waiting for Apple or Google play store’s approval.
- You can write mobile apps in javascript (it makes thing simpler).
- Basically, React Native makes your mobile a web-like feeling.
For anyone who want to read more:
- Why I’m not a react native developer (yeah it’s the dark side of the force)
- Swift vs React Native (Good read for IOS developer)
- Java or React Native discussion on Quora (Lots of opinion and information for you to slip on)
Why use React Native and not a webview?
In android or ios development, there is a thing called webview, it can show the app user a webpage of your choice. As I mention above, React Native gives you web-like feeling, so why not just put a web in it? Because if your company put good loads of money into making a web. It’s by standard, must be responsive.
This is something that has been bugging me for a while, some said it’s due to performance, others for better user experience and so on. But, in reality I really don’t know if that is true (I’m a skeptical man). So the only conclusion that I have now is that, You use React Native instead of a webview because you can have more control over your program design and data flow. (Like interacting with native components for example).
For more discussion you can check out these guys:
- An introduction to hybrid mobile app
- Interact with webview in java and Interact with React Native in java.
What is ES? I heard that javascript use ES6, 7 ,8, … and for god, a wtf amount of ES numbers with it. What exactly are those things?
ES stands for ecmascript:
- It is a Standard for a scripting languages. (What is scripting languages? Read here on stackoverflow).
- JavaScript is an implementation of the ECMAScript standard.
- ES6 means coding syntax in the sixth major release of the ECMAScript language specification. It does not represent the year they release (ES6 is released in 2015 according to wikipedia).
In short, ES6 is a type of syntax definition for javascript.
More on this: Discussion and questions on stackoverflow
There are Reactjs in web development, is Reactjs and React Native the same?
They are somewhat the same but different. Same but different
Reactjs is JavaScript library, supporting both front end web and being run on the server, for building user interfaces and web applications.
React Native is a mobile framework that compiles to native app components, allowing you to build native mobile applications (iOS, Android, and Windows) in JavaScript that allows you to use ReactJS to build your components, and implements ReactJS under the hood.
And they or both made by facebook
A good medium story already discuss this: Difference between Reactjs and React Native.
I am having a Window, Linus OS. Can I build iOS apps with React Native?
- You cannot build iOS normally on Window and Linus. You will need a Mac for this.
- Normally here means using bash, cmd command like “react-native run-ios” (Read through Facebook guide to setup react native you will know what this is).
- But you can build apps on actual iOS devices with EXPO. For what expo is I will write a whole part for it. But for now, just know that there is a will, there is a way.
This is my the biggest obstacle that I meet when developing React Native apps. You cannot build it normally on iOS when you dont have a MAC (There are alternative like Expo or if you really want it, install Hackintosh on your computer or use virtualbox to install MacOS on virtual machine, remember to obtain an apple id first, you will need it to download XCode-iOS development IDE). I tried all of them, all of them works but all of them took lots of time to build (since I have a weak laptop). If you have strong laptop or personal computer then I would recommend to go for virtual Mac or Hackintosh.
End
That’s that for this part. This is the first part of many more to comes. This also served as a memo to me, so I’m terribly sorry if at some points I started going around in circle. These are all the things that I learned and concluded by googling and reading stackoverflow (:”<) so it bounds to have flawed. Feel free to correct me, I will appreciate it a lots (Not understanding something is bad enough, but misunderstood it is the worst).