React is a JavaScript library for building user interfaces from reusable, composable components. Components turn changing data and user interactions into understandable interface descriptions. section 1.0 section 1.1
React’s core approach combines:
- Reusable components that can be nested into complex interfaces. section 1.1
- JSX, an HTML-like syntax that is compiled into JavaScript. section 1.1.1
- State and props that describe the latest data and UI requirements. section 1.1.2
- Scheduled DOM updates that keep the displayed interface synchronized with state. section 1.1.2
Quiz app with reusable toggles
A quiz can reuse one TextToggle component for both a question and its answer, passing title, text, and visibility as props: <TextToggle title="Question" text="Who created JavaScript?" show={true} />. A state change can hide or reveal the answer, causing the interface to re-render. section 1.1.1 section 1.1.2
Table 1.1 Some key steps when React calls and re-calls a function component (view table figure)
Trace the function-component cycle: React calls the component, it specifies handlers and returns UI, and React updates the DOM. section 1.1.2




