[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.
Brian Kung committed
Feb 17, 2015 at 06:40 UTC
26e0b1a298b7e66ae2c865efc726ff91a1c09e7e
1 file changed
+3
-2
docs/docs/02.1-jsx-in-depth.md
+3
-2
@@ -89,9 +89,10 @@ If you want to use JSX, the [Getting Started](/react/docs/getting-started.html)
89
90
## Namespaced Components
91
92
-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:
92
+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:
93
94
```javascript
95
+// Awkward block of variable declarations
96
var Form = MyFormComponent;
97
var FormRow = Form.Row;
98
var FormLabel = Form.Label;
@@ -107,7 +108,7 @@ var App = (
108
);
109
```
110
110
-Instead of declaring a bunch of variables at the top, you'll get just one component that has other components as attributes.
111
+To make it simpler and easier, *namespaced components* let you use one component that has other components as attributes:
112
113
```javascript
114
var Form = MyFormComponent;