Course contentsShow
← React Native
Lesson 22 of 1,5551. The React Native ArchitectureFree lesson

Mapping View Components to Native Views

You will be able to identify which native components (UIView vs android.view) are instantiated by standard React Native primitives.

In this lesson, you will learn how the React Native framework acts as a translator to turn your JavaScript code into real, platform-specific UI elements.

The Translator Role

When you write a React Native component like <View /> or <Text />, you are not actually writing code that runs on iOS or Android. Instead, you are describing a high-level UI intent. Because React Native is a cross-platform framework, it needs a way to bridge your code to the specific UI systems of the host platforms.

This process is handled by the UI Manager. When you define your component tree in JavaScript, React Native sends a description of that tree over the bridge (or via the JSI) to the native side. The UI Manager then reads these instructions and "maps" your generic React component to a concrete native class.

Concrete Examples

Think of it like a menu at a restaurant: you order a "generic burger," but the kitchen knows whether to fire it up on an electric grill (Android) or a gas stove (iOS).

  • <View />: On iOS, this maps directly to a UIView. On Android, it maps to android.view.ViewGroup.
  • <Text />: On iOS, this maps to UITextView (or sometimes UILabel). On Android, it maps to android.widget.TextView.
  • <Image />: On iOS, this maps to UIImageView. On Android, it maps to android.widget.ImageView.

Why This Matters

Because your components are mapped to these specific, native "View" classes, you aren't just drawing pixels on a screen like you would with a browser's HTML Canvas. You are actually instantiating real, heavyweight native objects.

When you change a prop in JavaScript—like changing a background color—the UI Manager performs a diff and sends an instruction to update the properties of that specific UIView or android.view instance. This is why the UI feels fluid: you are manipulating native objects that the operating system already knows how to render, animate, and handle touch events for, just as if you had written the app in Swift or Kotlin from scratch.

Key Takeaway: React Native components are merely declarative instructions that the UI Manager uses to instantiate and manipulate platform-specific native objects like UIView on iOS and android.view on Android.