Skip to main content

React Components, Props and State

Learn React Components, Props and State (Phase 15 · React (Essential for your chosen stack), JavaScript) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Thinking in components • React builds the UI from components : functions that take props (inputs) and return JSX (a description of the UI). • The UI is a function of state: when state changes, React re-renders the component and updates only the changed DOM. • JSX rules: one root element (or a fragment <>...</> ), className instead of class , { } to embed JavaScript, camelCase event props like onClick .

More lessons in Phase 15 · React (Essential for your chosen stack)