3 ms·
First of all - I enjoy using React in browser and consider it the best browser UI tech out there. At the same time I've been working with desktop and mobile app
by kikimora 10y ago
First of all - I enjoy using React in browser and consider it the best browser UI tech out there. At the same time I've been working with desktop and mobile apps for past 12 years and there are things that makes me very suspicious about React Native.
1. Native apps does not have anything like browser DOM. Most of complex controls recycle views based on internal control logic. I don't see how Virtual DOM idea can be mixed with that. To make UITableView Virtual DOM aware you will have to rewrite it from scratch.
Quote from here - https://medium.com/@talkol/recycling-rows-for-high-performance-react-native-list-views-628fd0363861#.so16r6s9j https://medium.com/@talkol/recycling-rows-for-high-performan...
>Recycling previously allocated rows that went off-screen is a very popular optimization technique for list views implemented natively in iOS and Android. The default ListView implementation of React Native avoids this specific optimization in favor of other cool benefits
2. Running event handlers in a separate thread is very bad idea. Appcelerator Titanium does same thing and it gave me all sorts of trouble in the past. For example - you scroll UIScrollView and it generates scroll events. These events asynchronously delivered to JS thread. JS thread change view position. UIScrollView expect these changes during scroll event not after and does not optimise for that. As a result you get gazillions layout/scroll events which kills layout performance. You also get tons of locking/unlocking as a bonus.
In Titanium delay between UI event sending event and JS thread receiving it was visible with naked eye. It was virtually impossible to create responsive UI due to these delays. React Native seems much better in this area but I suspect that complex cases like I described above will break.
3. People have been trying to build cross platform UI for decades. There are dozens of desktop technologies in this space. None of them got even close to the point of replacing native UI. Maybe React Native will be but statistics is not on their side.
Technologies which draw controls themselves does better than others which provide cross platform wrappers to native controls.
Java Swing, WPF, maybe QT - see some use, mostly in enterprise.
Java SWT, wxWidgets (I can add AWT here) - only SWT is being used in Eclipse, others are pretty much dead.
So I'm really sceptical about React Native future as a replacement for native UI. It might be useful in niche areas but polished apps might be very problematic.
You might also find this interesting
- Bloomberg rewrite it consumer app with React Native
https://www.techatbloomberg.com/blog/bloomberg-used-react-native-develop-new-consumer-app/ https://www.techatbloomberg.com/blog/bloomberg-used-react-na...
- Customers rate it one star - https://itunes.apple.com/us/app/bloomberg/id281941097?mt=8 https://itunes.apple.com/us/app/bloomberg/id281941097?mt=8
Couple of years ago I've spent few months digging into Appcelerator Titainum which is also based on JS and in a few of ways similar to React Native. After fixing few bugs in Titanium code base and even making myself familiar with WebKit internals I can tell that Titanium is complete a garbage without any hope for improvement. Major reason for this - they decided to run JS on separate thread for performance reasons.