react-principles
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.
What is NOT state
- Computable from existing state or props → derive during render
More from discountry/ritmex-skills
use-ctx7
Fetch up-to-date library documentation via the ctx7 CLI. Use PROACTIVELY whenever any code change, feature design, or implementation or user request involves a project dependency — always query the matching version's docs first before writing code.
30codex-prompt-optimize
>
8slack
Control Slack via the `slack` CLI to read, search, and manage messages, threads, files, reactions, channels, DMs, and canvases. Trigger on requests involving Slack messages, threads, URLs, channel history, unread or recent DMs, or sending/replying to messages (English or Chinese queries mentioning Slack).
3debug
>
2refactor
>
2clickup
Use for ClickUp tasks and docs. Trigger on ClickUp URLs, task IDs, list IDs, doc IDs, page IDs, assignees, statuses, due dates, comments, checklists, and document workflows. Use the global `clickup` CLI.
2