TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Tempted to Abandon React Native for Native Android

88 pointsby silkodysseyover 8 years ago

10 comments

htormeyover 8 years ago
To summarize this article: The author really enjoyed using React Native up until he hit some performance issues related to loading large images on certain versions of Android.<p>He doesn&#x27;t go into what specifically the performance issues were, any techniques he used to profile his app, what third party libraries he tired or anything.<p>Performance issues happen all the time with native apps that don&#x27;t use React Native. Optimizing is a core part of what a software engineer does. Giving up on weeks of learning without a good reason seems like a poor choice to me.<p>As it so happen&#x27;s I have been working with a colleague of mine who just fixed a React Native performance issue relating to images on Android on older devices. The author might want to check out the following article:<p><a href="https:&#x2F;&#x2F;facebook.github.io&#x2F;react-native&#x2F;docs&#x2F;performance.html#moving-a-view-on-the-screen-scrolling-translating-rotating-drops-ui-thread-fps" rel="nofollow">https:&#x2F;&#x2F;facebook.github.io&#x2F;react-native&#x2F;docs&#x2F;performance.htm...</a><p>Our particular issue was solved by the following:<p>&quot;This is especially true when you have text with a transparent background positioned on top of an image, or any other situation where alpha compositing would be required to re-draw the view on each frame. You will find that enabling shouldRasterizeIOS or renderToHardwareTextureAndroid can help with this significantly.&quot;<p>Apart from the above, this article is pretty shallow, which is sad because I would love to read a good article on React Native&#x27;s performance. Perhaps I will write one if people are interested.
评论 #13569573 未加载
评论 #13570137 未加载
t1amatover 8 years ago
I&#x27;ve been playing a lot with React Native over the last year; professionally for almost 4 months now. This really aligns with my experience. I don&#x27;t share the same opinion of going back to native code though.<p>This really is a fantastic platform. You really can, today, write native cross platform and web apps with the same code base. With few exceptions, everything from including native modules to upgrading is painless. The UI metaphor is fantastic, the tooling is superb, the editor support is there, the community is growing. It&#x27;s a great place to be.<p>It&#x27;s not without it&#x27;s warts though. From my experience, the real problems stem from the 3rd party native modules. It&#x27;s not even their fault, the platform is just moving so fast. As recently as the 0.40 release, every native module out there was broken on iOS for a short period of time. I was the first to submit PR&#x27;s to two fairly widely used ones, and that was multiple days after the release. On this point, I believe this is more indicative of a community that generally doesn&#x27;t upgrade their projects right away- a combination of painful prior experience and a deep seeded distaste of having to re-release their app on all stores as you can leverage a tool like Microsoft Code Push to change the bundle as long as it is compatible with the native shell.<p>Of the two RN projects I&#x27;m working, both have at least one dependency pinned to a Github fork I have of a project, waiting for my patches to be released. This sounds worse than it is, as the majority of native modules are hilariously small and easy to modify, but it still is worth mentioning as a point of friction today. As the community grows, I expect this will diminish.
评论 #13569447 未加载
评论 #13573277 未加载
评论 #13572427 未加载
grandalfover 8 years ago
I&#x27;ve done some work with react native, and have definitely been disappointed by the poor quality of many third party libraries that are not supported by Facebook.<p>This is a big opportunity for those who might wish to make a name for themselves by developing some top quality open source components, but I also think Facebook should do a bit more to make using the phone&#x27;s core features in a very high quality way as easy as possible. Things like the camera, audio recording, video, etc., are handled only via third party libraries.<p>The third party open source work is improving, and I&#x27;m grateful it exists, but much of it lacks contributors. Many have large lists of unresolved issues on github.<p>It would be very smart choice for Facebook to put a dozen or so developers on the task of submitting high quality PRs for the top 20 open source non-facebook libraries.
nurettinover 8 years ago
I searched for the holy grail of cross-platform goodness like a fool for years. I now have my first native UI android application on google play and I don&#x27;t regret the decision. I made a prototype and then optimized it in ways I wasn&#x27;t able to do in html or react-native. (try downloading and caching pictures rendered in a listview asynchronously while keeping the scroll smooth)<p>I now don&#x27;t have an iOS version, but in my opinion having a finished product that is already gaining traction makes up for the lost time of learning to make the same thing for iOS.
评论 #13571970 未加载
评论 #13571280 未加载
hammerandtongsover 8 years ago
My next foray into mobile is going to be with this-<p><a href="https:&#x2F;&#x2F;www.nativescript.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.nativescript.org&#x2F;</a><p>Digging through the api it just looks much more capable in directly calling android instead of abstracted cross platform blobs.
评论 #13569210 未加载
评论 #13570976 未加载
评论 #13569184 未加载
评论 #13569281 未加载
评论 #13571283 未加载
评论 #13576402 未加载
edover 8 years ago
Sounds like a good opportunity to build some performance-tuning muscle :)<p>Whether using RN or java, you&#x27;ll want to know how to debug memory&#x2F;performance issues on Android - they&#x27;re mostly unavoidable on mobile devices!<p>(And maybe you can file some issues against React Native, too, which would be great and help the platform)
评论 #13569193 未加载
评论 #13569107 未加载
Hydraulix989over 8 years ago
It&#x27;d be nice with React Native was actually &quot;native&quot; and not just a JS interpreter (really not that much different than HTML5 running in a browser). No wonder there are performance issues.
评论 #13571250 未加载
teycover 8 years ago
If you already know how to do the image related task in Native Android, you could spike a test project and verify that it&#x27;s performant on the smaller devices and the problem could be attributed to React Native alone. Then it&#x27;s a matter of porting the high level API to JS.<p>Given that you believe this is a memory-related problem, perhaps it&#x27;s because the image is too large to fit into the available memory, and having React Native made it worse.
评论 #13569731 未加载
EGregover 8 years ago
What do you all think of Cordova? Do the author&#x27;s comments apply there also? Does it crash from using too much memory after a while of loading objects? And does it make things not work on older devices and platforms making it a dealbreaker for anyone?
评论 #13571610 未加载
评论 #13571802 未加载
silkodysseyover 8 years ago
I posted a follow-up to this story talking about further explorations based on the feedback I got from your comments.<p><a href="https:&#x2F;&#x2F;kelvinpompey.me&#x2F;tempted-to-abandon-react-native-for-native-android-part-2&#x2F;" rel="nofollow">https:&#x2F;&#x2F;kelvinpompey.me&#x2F;tempted-to-abandon-react-native-for-...</a>