๐Ÿ“Š We use cookies & analytics to improve your experience. Learn more
Latest

React & Modern Front-End Development Module 1 ยท Lesson 1 of 15

0% Exit to course

Module 1 ยท Components and JSX Lesson 1 of 15

A component is just a function

Learning objective

A React component is a function that returns markup. Its name starts with a capital letter, and it returns JSX โ€” HTML that looks like JavaScript because it is.

Worked example

function Card() { return <h3>Hello</h3>; } is a complete component. Everything else in React โ€” state, effects, routing โ€” is a tool you attach to functions like this one.

Your practice task

Take a static page you already have and split it into four components: header, list, list item and footer. Nothing else changes yet.

Do this before moving on. Reading a solution teaches the shape of it; typing it teaches you.

Key takeaway

A React component is a function that returns markup. Its name starts with a capital letter, and it returns JSX โ€” HTML that looks like JavaScript because it is.

Create free account or sign in

Almost there

15 lessons left of 15

Finish every lesson to unlock the certificate. Each one ends in a practice task โ€” do them and the final project brief writes itself.

Next recommended course Full-Stack Web Development Bootcamp