Topic
React components
A React component describes part of a user interface through reusable code. Components can be composed into larger screens, and inputs called props let a parent supply information.
At a glance
- Parent-supplied inputs
- Props
- Composition
- Components nested within components
Overview
A React component describes part of a user interface through reusable code. Components can be composed into larger screens, and inputs called props let a parent supply information. Separating components around clear responsibilities makes an interface easier to reason about.
Choosing boundaries
A component boundary should reflect a meaningful part of the interface or a reusable behavior. A screen can be decomposed into smaller pieces without turning every visual wrapper into its own abstraction.
Data and rendering
Props provide information for rendering, while state tracks values that change over time. The rendered output should follow those values so that the interface remains consistent as data changes.
Sources and review
MOOR's explanatory text is supported by the following source links.
- Quick Start — React
- Thinking in React — React