DrSchool Learn coding, fast.
EN AR BN CS DE EL Search

REACT: Components

Learn Components in REACT with practical examples.

Read time: 1 min Words: 30
My Progress

REACT — Components

Overview

Components are reusable UI building blocks.

What you'll learn

  • function components
  • props
  • composition

Syntax

function Card(){ return <div/> }

Example

function Card({ title }){
  return <div className="card">{title}</div>;
}

export default function App(){
  return <Card title="Hello" />;
}

Notes

  • Name components with capital letters.
  • Split UI into small pieces.