diff --git a/docs/02.1-jsx-in-depth.md b/docs/02.1-jsx-in-depth.md index 14924f74..43ce01c5 100644 --- a/docs/02.1-jsx-in-depth.md +++ b/docs/02.1-jsx-in-depth.md @@ -133,6 +133,68 @@ var tree = Nav(null, React.DOM.span(null)); > DOM. The docblock parameter is only a convenience to resolve the most commonly > used elements. In general, JSX has no notion of the DOM. +## Namespaced Components + +If you are building a component that have a lot of childrens, or if you are building your application with some categories of reusable components (like a `Form` category), to make more simple and easiest, you can use a *namespaced component* to avoid something like this: + +```javascript +var Form = Form; +var FormRow = Form.Row; +var FormLabel = Form.Label; +var FormInput = Form.Input; + +var App = ( +
+); +``` + +Instead of declare a bunch of variables at the top, you'll get just one component that have other components as attributes. + +```javascript +var Form = Form; + +var App = ( +