Advantages of native react

Source: Internet
Author: User

Source: Know

React native takes full advantage of Facebook's existing wheels, is a very good integration work, and I believe the team has a deep understanding of the front end, otherwise it is impossible to let native code"take a backseat."

Corresponding to the front-end development, the entire system structure is this:

JSX vs HTML

Css-layout vs CSS

ECMAScript 6 vs ECMAScript 5

React Native View vs DOM

No need to compile, I in the first compilation of the IPA installed, it has not updated the app, as long as the update of the Cloud JS code, reload, the entire interface has changed.

Most of the layout code is JSX, all the native components are labeled, which for the front-end programmer, reduce a lot of learning costs, but also greatly reduce the amount of code. Don't believe you can look at the JSX compiled code.

The reuse react system also reduces the cost of learning and development, and more importantly, uses the layering and diff mechanism within the react. JS layer to the native layer is a diff json, and then by native to map this data into a real layout view.

Css-layout is also the finishing touches, the front end can continue to use familiar CSS style to write layout, through this tool to convert to constrain layout.

The system only JS-OBJC one-way call, that is, the native UI component of the method through Javascritcore or WebView (low version of iOS) mapped to JS, the entire call process is asynchronous, such a design to react Native allows JS to run in desktop chrome, connecting native code and desktop chrome via WebSocket, greatly facilitating debugging. The mechanism of the bang of one of the articles written in very detailed, I will not merely: React native communication mechanism detailed «bang ' s blog. But this design also brings some problems, said the latter.

The point-and-click operation is also abstracted into a set of components (TOUCHABLEXXX), an abstraction that I did not think of before doing similar work. Facebook also lists why native and web"feel" different reasons: real-time tap feedback and cancellation capabilities. React Native This set of mechanisms is well-designed to control the entire process of clicking Operations like Native code.

Debug is quite handy! After modified JS, through the built-in Nodejs watcher compiled into bundles, in the simulator inside press Cmd+r can see the effect. and press Cmd+d, you can open a chrome window, all the JS are moved to Chrome inside the run, so what breakpoint single-step call stack, is a cinch.

Steady profit financial assistant development difficulty mainly lies in the current native react not ripe, the next will improve speed.

Advantages of native react

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.