From 4b16e13212ceb6d03062987841d369542990de71 Mon Sep 17 00:00:00 2001 From: Brian Kung Date: Tue, 17 Feb 2015 06:40:48 -0600 Subject: [PATCH] [Docs] Clarify section on namespaced components While going through the docs, I wasn't sure if the first example was something I should do or not. This makes the wording a bit more clear. --- docs/02.1-jsx-in-depth.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/02.1-jsx-in-depth.md b/docs/02.1-jsx-in-depth.md index 45f00e243..255789634 100644 --- a/docs/02.1-jsx-in-depth.md +++ b/docs/02.1-jsx-in-depth.md @@ -89,9 +89,10 @@ If you want to use JSX, the [Getting Started](/react/docs/getting-started.html) ## Namespaced Components -If you are building a component that has many children, or if you are building your application with some categories of reusable components (like a `Form` category), to make it simpler and easier, you can use a *namespaced component* to avoid something like this: +If you are building a component that has many children, like a form, you might end up with something with a lot of variable declarations: ```javascript +// Awkward block of variable declarations var Form = MyFormComponent; var FormRow = Form.Row; var FormLabel = Form.Label; @@ -107,7 +108,7 @@ var App = ( ); ``` -Instead of declaring a bunch of variables at the top, you'll get just one component that has other components as attributes. +To make it simpler and easier, *namespaced components* let you use one component that has other components as attributes: ```javascript var Form = MyFormComponent;