From 01af016d978c818e9dffb6c95e06bec952b17119 Mon Sep 17 00:00:00 2001 From: Ricky Smith Date: Thu, 12 Mar 2026 11:07:41 +0100 Subject: [PATCH] Coding Guidelines: Controllable React Components --- docs/docs/9-coding-guidelines/09-react.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/docs/9-coding-guidelines/09-react.md b/docs/docs/9-coding-guidelines/09-react.md index c9c2248a28..628ce10f9b 100644 --- a/docs/docs/9-coding-guidelines/09-react.md +++ b/docs/docs/9-coding-guidelines/09-react.md @@ -13,6 +13,10 @@ sidebar_position: -5 - How to structure folders: "Move files around until it feels right." Recommendation: separate by modules instead of by type ([File Structure – React](https://legacy.reactjs.org/docs/faq-structure.html#grouping-by-features-or-routes)). +## Reusable, Controllable Components + +Reusable components should generally be controllable. Expose props (e.g., `value`, `open`) and change handlers (e.g., `onChange`, `onOpenChange`) so consumers can manage state externally. For application-specific components where reuse is not a concern, managing state internally is perfectly fine. + ## Naming ### Casing