Happy Dragon Boat Festival holiday. During the holiday, I quickly browsed through the official documentation of React Native and would like to share my thoughts.
Background#
Due to my current work, I have been dealing with some logic related to uni-app x updates on iOS. I don't know how far uni-app x has evolved, so I wanted to take a look at React's cross-platform solution, which is undoubtedly React Native. I quickly browsed through the official website and made some notes for myself. I won't share the article here as they are just scattered notes. Here, I will compare it with uni-app x and share my insights.
Visit React Native · Learn once, write anywhere
Website Reading Experience#
As a beginner, I have visited the official websites of Flutter, Android, and Swift. I wanted to see how quickly I can get an app up and running and if there are any tutorial guides. I feel that these websites are average, but they are better than websites like SpringBoot/MySQL, at least in terms of aesthetics.
The reading experience of React Native is slightly better. In terms of overall structure, it still follows the major structure of technical websites: Guides for getting started, Docs for system documentation, API Index, and Playground for preview.
Quickly Seeing Results#
Since it is not possible to preview the client's effect on the website, Expo, which is a shell app, can be used to scan the QR code and preview the effect at any time, which is very intuitive. React Native now fully recommends Expo as the framework, and even beginners can quickly start a demo application through npm commands and achieve local effects.
Interestingly, during the quick development process, there is no need to deliberately explain Android Studio and XCode. The experience is quite good, unlike Flutter, which discourages beginners.
From a beginner's perspective, I think it is very good to introduce a framework. Complex content can be postponed, and it should be studied seriously when needed. Compared to uni-app x, because of HBuilderX, many concepts are naturally shielded, which can also be considered as a comparison of framework implementations.
Always remember that for beginners and users who have just started, it is not good to expose parameters too early. Shield the details first, get it up and running, and then optimize and implement advanced features. It is appropriate.
System Learning Enthusiast#
In the Basic section of the Guides, only the most common concepts are introduced, which I think is right.
After the basic part, when the systematic explanation starts, I think it is also very good. From the perspective of the software development lifecycle, it gradually unfolds the environment preparation before development, the overall workflow, how to layout and draw pages, debugging, automated testing, performance tuning, etc. The unavoidable native interaction part is also introduced first before continuing.
Unfortunately, as a beginner, even after reading it, I didn't understand the current status of the so-called Legacy structure and the new architecture. I didn't understand. It seems that the RN architecture has changed, but I didn't understand what stage it is in now.
Documentation Does Not Support Multiple Languages#
The official website does not support multiple languages, but I saw that someone is maintaining a Chinese website for RN, which is an unofficial version.
React Native Chinese Website · A framework for writing native applications using React
I was afraid that it might be outdated, so I didn't dare to read it too much. Later, I randomly clicked on it and it seemed not very new. The author may be the author of the Geek Time course, promoting the course and other related products.
Thinking about it, not supporting internationalization is also normal. Only these libraries related to the front-end have relatively timely updates on internationalization. No one is working on the workflow.
Emphasizing Frameworks Instead of Free Combination#
At first, I didn't realize that Expo is not officially provided by RN. It is indeed React, somewhat similar to the relationship between React and Next.js: encouraging the use of frameworks instead of writing a bunch of configurations by yourself.
I only found out when I was reading the outdated Chinese documentation that they encourage the use of the react-native-cli
package. Currently, in the official website, you need to deliberately search to find the introduction. They earnestly recommend the framework, but if you insist on your own assembly, they also leave a tail.
When entering the Expo official website, for example, if I want to use the native API of the camera, I can install a plugin to achieve it. This is also an ecosystem, somewhat similar to Ionic. It provides shell containers and plugin ecosystems.
Open Architecture#
The React Native official website only maintains Android and iOS platforms, and the support for the web is maintained by the community and third parties. For example, Windows/MacOS is also maintained by the community. Creating a new architecture is also possible.
However, I searched for React Native Harmony and found no results.
Additional Extension#
I particularly like xlog. I noticed that the client of xlog.app is also built using Expo, and it is open source. Maybe I can take a further look in the future.