Components & JSX

medium

Complete guide with examples and interview questions · 40 min

Definition

Say it out loud in an interview — clear, simple, no textbook wording.

React models UI as a function of state. Components are the building blocks — each one returns a tree of elements describing what should appear on screen.

JSX is the syntax you write in .jsx files: it looks like HTML but compiles to React.createElement(type, props, ...children).

Quick Stats
40
Minutes
medium
Difficulty
4
Interview Q's

Key takeaways

  • JSX is syntactic sugar for React.createElement
  • Components are functions that return UI descriptions
  • Props flow down; each render produces a new element tree
  • Reconciliation compares element type and keys on updates

Track your mastery

Sign in to save Q&A scores, coding challenge progress, points, and streaks across devices.

Sign in to save progress