Document displayName
xixixao committed
Jan 4, 2014 at 17:34 UTC
ee0a4acfac483e0a69a4c8062bbd9331ba88aa3e
2 files changed
+12
docs/docs/02.1-jsx-in-depth.md
+3
@@ -97,6 +97,9 @@ var MyComponent = React.createClass({/*...*/});
97
var app = <MyComponent someProperty={true} />;
98
```
99
100
+JSX will infer the component's name from the variable assignment and specify
101
+the class's [displayName](/react/docs/component-specs.html#displayName) accordingly.
102
+
103
See [Multiple Components](/react/docs/multiple-components.html) to learn more about using composite components.
104
105
> Note:
docs/docs/ref-03-component-specs.md
+9
@@ -67,6 +67,15 @@ The `mixins` array allows you to use mixins to share behavior among multiple com
67
<!-- TODO: Document mixins here directly. -->
68
69
70
+### displayName
71
+
72
+```javascript
73
+string displayName
74
+```
75
+
76
+The `displayName` string is used in debugging messages. JSX sets this value automatically, see [JSX in Depth](react/docs/jsx-in-depth.html#react-composite-components).
77
+
78
+
79
## Lifecycle Methods
80
81
Various methods are executed at specific points in a component's lifecycle.