Browse Source

Document displayName

main
xixixao 11 years ago
parent
commit
4c7abcd424
  1. 3
      docs/02.1-jsx-in-depth.md
  2. 9
      docs/ref-03-component-specs.md

3
docs/02.1-jsx-in-depth.md

@ -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:

9
docs/ref-03-component-specs.md

@ -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.

Loading…
Cancel
Save