So you are planning to use ReactNative for Android Development?! I’ve made some first steps with this brand new technology created by Facebook. Here is why I think that you should NOT use ReactNative for serious development! As always, if you disagree with this, just let me know in the comments so we can discuss and maybe you prove me wrong and convince me that ReactNative is actually great!
Always alpha and beta
ReactNative is too new for me. I personally don’t like that nearly everything is in early alpha and beta status, because this often leads to undesired behavior of those libs. If you want a certain behavior for something it is hard to find a good working, solid, non crashing library to use. In my daily work this means I have three options:
– implement desired function on my own
– use Java-Lib and call it from ReactNative
– try alpha/beta lib and hope for the best
I love Java and that for nearly every problem there is a well tested Library I can use or if I want to switch for beta/alpha stuff it is my own decision. Short example in ReactNative: I cannot make images which are squared round in ReactNative. I’ve tried a lot of different Libraries and those who are able to render the image round are not able to load images from HTTPS with auth-header, so I ended up telling the client, that currently it is not possible to have a round image. Feels so bad for me…
During the last months developing with ReactNative I’ve ended up writing a lot of JavaCode. The first weeks were like: WOW how fast I can implement feature using ReactNative! Now I am like: Okay I am fast, but this is better to do in Java and this feature is better placed in Java too. This is from my point of view because it is hard to make Android API Calls from ReactNative, like Intents for specific sharing functions.
WHERE ARE MY OBJECTS!?!?!?!?!
Okay pants down! I love Java and I love object oriented programming! I am totally missing this in ReactNative. I have to admit, that changing from OOP to something else is always a strange feeling… Example for better understanding:
I have a list of elements to display. The elements are dynamic and change often. For analyzing the user behavior it is very important for the data scientists to know when a certain element is visible to the user. In Java it was very easy, as objects, callbacks and stuff like this. In ReactNative I have not found such an easy solution. Therefore the height for each element is now fixed, which is not very pleasant for the customer, but having the pixels scrolled, I was able to calculate which element should be visible to the user. This is only accurate 90%, so each predictions made of this data… I hope you get the point…
This is a total personal point, but I have the feeling that my ReactNative app’s apk is getting bigger and bigger. A much more faster than it would have using only Java.
WHY?! WHY?! WHY?! Why are the method calls in ReactNative asnyc? This confused me the most when switching to ReactNative and it still does, as my solution to this creates a lot of boilerplate code. When calling a method which return an important value, which I need one line after, I am expecting the app to wait till the method call has returned. BUT NO! In RN the method is called, and the next line is executed immediately and for me there is no valid point doing so! If I want something to be executed asynchronously I want to be the one actively doing it this way but not by default! Calling method is a crucial part of my daily programmers life!
My solution is to use promises everywhere and calling the next code in the resolve part of the promise…. Another point feeling very bad every day…