Dualo
React Basics

Components & Props

Build your UI from small, reusable pieces driven by inputs.

1 min read

A React is a function that takes a object and returns a (or null). Components must be during render: same props + same state ⇒ same output, no side effects.

Props are read-only. Mutating them is a bug; to propagate changes, pass new references from the parent.

React encourages over inheritance: pass JSX through `children` or named render-prop slots instead of extending class hierarchies.

Diagram

Grounded on https://react.dev/learn/passing-props-to-a-component

Next up

State & useState

Give components memory so they can react to user interactions.