react-principles
Installation
SKILL.md
React Development Principles
Component Model
- Components are pure functions:
(props, state) → JSX. Render must be side-effect-free. - One-way data flow: parent → child via props, child → parent via callbacks.
- Never mutate state or props in-place.
Thinking in React: Design Process
- Hierarchy — decompose by SRP; one component, one concern. Map data model shape to component tree.
- Static first — props only, no state, until the skeleton renders correctly.
- Minimal state — DRY: if it's derivable, it's not state.
- Ownership — hoist state to the closest common ancestor of all consumers.
- Inverse flow — pass setters/handlers down; children call them on interaction.