Document displayName

This commit is contained in:
xixixao
2014-01-04 17:34:16 +01:00
parent 80d7d2d0f8
commit ee0a4acfac
2 changed files with 12 additions and 0 deletions

View File

@@ -97,6 +97,9 @@ var MyComponent = React.createClass({/*...*/});
var app = <MyComponent someProperty={true} />;
```
JSX will infer the component's name from the variable assignment and specify
the class's [displayName](/react/docs/component-specs.html#displayName) accordingly.
See [Multiple Components](/react/docs/multiple-components.html) to learn more about using composite components.
> Note:

View File

@@ -67,6 +67,15 @@ The `mixins` array allows you to use mixins to share behavior among multiple com
<!-- TODO: Document mixins here directly. -->
### displayName
```javascript
string displayName
```
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).
## Lifecycle Methods
Various methods are executed at specific points in a component's lifecycle.