Rendering

The Virtual DOM of React is usually thought of as a performance optimization technique, but it's also much more than that. It's an abstraction layer between the code describing how the application should look, and the actual rendering of those elements. This is called the "bridge", providing an interface from React Native to the host platform's native APIs. React’s rendering to the browser's DOM was explained previously in Figure 1. React Native’s rendering is pictured here in Figure 2: instead of the browser’s DOM, React Native is calling iOS's Objective-C APIs or Android's Java APIs to render native elements via the bridge. (Eiseman 2016.)

Rendering to different platforms with the Virtual DOM in React Native :








Because React Native is using the native iOS or Android APIs, applications developer with React Native look and feel exactly like real native iOS or Android applications, only developed using JavaScript. React Native also runs in a different process than the one rendering the UI, so applications feel fast and responsive. (Eiseman 2016.)

React Native currently works on iOS and Android, but because of the Virtual DOM and the abstraction layer it provides, it could run on other platforms too, just by writing another "bridge" component for the platform. (Eiseman 2016.) In fact, Facebook and Microsoft announced upcoming support for Windows at the F8 Conference in April 2016. React Native will get Universal Windows Platform support through a new open-source framework, which could even mean Xbox One and and HoloLens support. (Microsoft 2016,)


Comments

Popular posts from this blog

Size & Dimensions & onLayout

Data - Networking - Fetch

Absolute & Relative