← All courses

Components, Props & JSX

🗓 May 31, 2026 ⏱ 1 min read

Components

A component is a function that returns UI written in JSX. Props are inputs from a parent.

function Greeting({ name }) {
  return <Text>Hi, {name}!</Text>;
}

// usage
<Greeting name="Anand" />

Core components

  • View — a container (like a div).
  • Text — all text must be inside this.
  • Image — show images.
  • ScrollView — scrollable content.
  • Pressable / Button — handle taps.
<Pressable onPress={() => console.log('tapped')}>
  <Text>Tap me</Text>
</Pressable>
Tip: Components must return a single root element. Wrap siblings in a <View> or a fragment <>...</>.