Thuta Learning
React Native
BasicMobile DevelopmentIntermediate

Core Components (View, Text, Image, ScrollView)

React NativeLesson 420 min

What you'll walk away with

  • Explain the React and native-platform behavior of Core Components (View, Text, Image, ScrollView)
  • Test accessibility, failure, and lifecycle cases
  • Write maintainable, testable, and performant React Native

Explain it simply

Core Components (View, Text, Image, ScrollView), in plain language

View is a layout container (similar to HTML's <div>) — used to group and arrange child components. Text is the only component for displaying text content (text styling like font size/color has to happen inside Text). Image is for displaying pictures and accepts either a local file (require) or a remote URL (uri). ScrollView is a container that lets content scroll when it exceeds the screen height — needed whenever there's a lot of content.

Problem → Why → Solution

The problem — why this concept matters

Mixing up local file (require) and remote URL (uri object) syntax for Image source

A common mistake

Defaulting to ScrollView even for short content, causing unnecessary nesting

Core concept — understand how it works

Treat Core Components (View, Text, Image, ScrollView) as a native UI contract covering Yoga constraints, pixel density, font scaling, safe areas, the keyboard, touch targets, the accessibility tree, and iOS/Android differences—not merely screen styling syntax.

Mental model
  1. JavaScript state
  2. native component and layout
  3. Android or iOS UI

Explain the React and native-platform behavior of Core Components (View, Text, Image, ScrollView)

Core syntax or pattern

javascript
import { View, Text, Image, ScrollView, StyleSheet } from 'react-native';

export default function ProfileScreen() {
  return (
    <ScrollView style={styles.container}>
      <Image
        source={{ uri: 'https://example.com/avatar.png' }}
        style={styles.avatar}
      />
      <Text style={styles.name}>Mya Mya</Text>
      <Text>Software developer, learning React Native.</Text>
    </ScrollView>
  );
}

const styles = StyleSheet.create({
  container: { flex: 1, padding: 16 },
  avatar: { width: 100, height: 100, borderRadius: 50 },
  name: { fontSize: 20, fontWeight: 'bold', marginTop: 8 },
});

Treat Core Components (View, Text, Image, ScrollView) as a native UI contract covering Yoga constraints, pixel density, font scaling, safe areas, the keyboard, touch targets, the accessibility tree, and iOS/Android differences—not merely screen styling syntax.

Read the code step by step

  1. JavaScript stateimport { View, Text, Image, ScrollView, StyleSheet } ...

    View is a layout container (similar to HTML's <div>) — used to group and arrange child components. Text is the only component for displaying text content (text styling like font size/color has to happen inside Text). Image is for displaying pictures and accepts either a local file (require) or a remote URL (uri). ScrollView is a container that lets content scroll when it exceeds the screen height — needed whenever there's a lot of content.

  2. native component and layout<Text>Software developer, learning React Native.</Text>

    Treat Core Components (View, Text, Image, ScrollView) as a native UI contract covering Yoga constraints, pixel density, font scaling, safe areas, the keyboard, touch targets, the accessibility tree, and iOS/Android differences—not merely screen styling syntax.

  3. Android or iOS UI});

    Test an original Core Components (View, Text, Image, ScrollView) example on Android and iOS with small and large screens, font scaling, dark mode, keyboard and screen reader use, slow/offline networking, denied permissions, and background/foreground transitions. Use DevTools, tests, and a release build where relevant.

Execution flow
  1. JavaScript state
  2. native component and layout
  3. Android or iOS UI

Success

Explain the React and native-platform behavior of Core Components (View, Text, Image, ScrollView)

Failure

Mixing up local file (require) and remote URL (uri object) syntax for Image source

Let's think about this for a moment

View is a layout container (similar to HTML's <div>) — used to group and arrange child components. Text is the only component for displaying text content (text styling like font size/color has to happen inside Text). Image is for displaying pictures and accepts either a local file (require) or a remote URL (uri). ScrollView is a container that lets content scroll when it exceeds the screen height — needed whenever there's a lot of content.

Let's connect this to a real scenario

When building a profile screen, it's common to put an Image (profile photo) and Text (name, bio) inside an outer View, with the rest of the content inside a ScrollView — since screen sizes vary across phones, if the content is long and ScrollView is missing, whatever falls below the fold simply won't be visible.

Code Example

javascript
import { View, Text, Image, ScrollView, StyleSheet } from 'react-native';

export default function ProfileScreen() {
  return (
    <ScrollView style={styles.container}>
      <Image
        source={{ uri: 'https://example.com/avatar.png' }}
        style={styles.avatar}
      />
      <Text style={styles.name}>Mya Mya</Text>
      <Text>Software developer, learning React Native.</Text>
    </ScrollView>
  );
}

const styles = StyleSheet.create({
  container: { flex: 1, padding: 16 },
  avatar: { width: 100, height: 100, borderRadius: 50 },
  name: { fontSize: 20, fontWeight: 'bold', marginTop: 8 },
});
You should see
You'll be able to lay out a profile screen so the avatar image, name, and bio are scrollable.

5-Minute Try-It

Combine View, Text, Image, and ScrollView to build your own simple profile screen.

A Quick Heads-Up

If you don't set width/height in Image's style, the picture might not show up at all (there's no default size) — a local file can sometimes auto-size, but a remote URI always needs an explicit width/height.

Real-world usage

How to apply it in a real project

Test an original Core Components (View, Text, Image, ScrollView) example on Android and iOS with small and large screens, font scaling, dark mode, keyboard and screen reader use, slow/offline networking, denied permissions, and background/foreground transitions. Use DevTools, tests, and a release build where relevant.

Mini challenge

Build it yourself

Test an original Core Components (View, Text, Image, ScrollView) example on Android and iOS with small and large screens, font scaling, dark mode, keyboard and screen reader use, slow/offline networking, denied permissions, and background/foreground transitions. Use DevTools, tests, and a release build where relevant.

  • Rebuild the example without copying it
  • Test a normal input and an edge case
  • Predict the compiler or output result before running it
javascript
import { View, Text, Image, ScrollView, StyleSheet } from 'react-native';

export default function ProfileScreen() {
  return (
    <ScrollView style={styles.container}>
      <Image
        source={{ uri: 'https://example.com/avatar.png' }}
        style={styles.avatar}
      />
      <Text style={styles.name}>Mya Mya</Text>
      <Text>Software developer, learning React Native.</Text>
    </ScrollView>
  );
}

const styles = StyleSheet.create({
  container: { flex: 1, padding: 16 },
  avatar: { width: 100, height: 100, borderRadius: 50 },
  name: { fontSize: 20, fontWeight: 'bold', marginTop: 8 },
});

Expected: Explain the React and native-platform behavior of Core Components (View, Text, Image, ScrollView)

Show hint

Test an original Core Components (View, Text, Image, ScrollView) example on Android and iOS with small and large screens, font scaling, dark mode, keyboard and screen reader use, slow/offline networking, denied permissions, and background/foreground transitions. Use DevTools, tests, and a release build where relevant.

Quick quiz 1 / 3

What best describes the core idea of Core Components (View, Text, Image, ScrollView)?

Quick quiz 2 / 3

Which mistake should you avoid first?

Quick quiz 3 / 3

How should this be applied in a real project?

What to remember

  • JavaScript state → native component and layout → Android or iOS UI
  • Treat Core Components (View, Text, Image, ScrollView) as a native UI contract covering Yoga constraints, pixel density, font scaling, safe areas, the keyboard, touch targets, the accessibility tree, and iOS/Android differences—not merely screen styling syntax.
  • Mixing up local file (require) and remote URL (uri object) syntax for Image source
  • Test an original Core Components (View, Text, Image, ScrollView) example on Android and iOS with small and large screens, font scaling, dark mode, keyboard and screen reader use, slow/offline networking, denied permissions, and background/foreground transitions. Use DevTools, tests, and a release build where relevant.

React Native Documentation — React Native

Easy traps

  • Mixing up local file (require) and remote URL (uri object) syntax for Image source
  • Defaulting to ScrollView even for short content, causing unnecessary nesting
  • Assuming one simulator's happy path proves every real-device, release-build, permission, accessibility, offline, and lifecycle path.

Hands-on Exercise

Test an original Core Components (View, Text, Image, ScrollView) example on Android and iOS with small and large screens, font scaling, dark mode, keyboard and screen reader use, slow/offline networking, denied permissions, and background/foreground transitions. Use DevTools, tests, and a release build where relevant.

You'll know it worked when: You'll be able to lay out a profile screen so the avatar image, name, and bio are scrollable.

Updated on

Progress is saved only in this browser on this device. It isn't synced to other devices.

Report a problem with this lessonOpens your email app with this lesson's address filled in — nothing is sent until you send it.

Core Components (View, Text, Image, ScrollView) | Thuta Learning