Full stack development

Stage 2 · Lesson 3 of 8

Components, JSX and props

Git, npm and React

A interface is a tree of . A component is a function that takes props (its inputs) and returns JSX, which looks like and describes what should appear. Props flow one way, from parent to child.

A component should never change the props it receives. Learn to split a screen into components, one per job. To render a list, use map and give each item a stable key: an id from your data, not the array position, when items can move.

To show something only sometimes, use && or a ternary (a ? b : c). The children prop lets you build a wrapper, like a Card or Layout, that can hold anything. In the first stage you changed the (the page's live structure) by hand.

Here React updates it for you. The new question is where each piece of data should live, which the next topic answers.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

  • GuideFree
    React Documentation

    Meta

    Free official course; Thinking in React and Managing State matter most

  • CourseFree
    Next.js Learn

    Vercel · Intermediate

    Free official course: the first chapters build pages, layouts and navigation

Practise

Keep handy

Mark this stage as not done?