Browse Source

Merge pull request #3341 from rickbeerendonk/3338-documentation-issue

Add documentation about JSX and displayName.
main
Jim 10 years ago
parent
commit
c43546b376
  1. 9
      docs/02.1-jsx-in-depth.md
  2. 2
      docs/ref-03-component-specs.md

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

@ -73,6 +73,15 @@ var app = React.createElement(
);
```
JSX will infer the class's [displayName](/react/docs/component-specs.html#displayName) from the variable assignment when the displayName is undefined:
```javascript
// Input (JSX):
var Nav = React.createClass({ });
// Output (JS):
var Nav = React.createClass({displayName: "Nav", });
```
Use the [JSX Compiler](/react/jsx-compiler.html) to try out JSX and see how it
desugars into native JavaScript, and the
[HTML to JSX converter](/react/html-jsx.html) to convert your existing HTML to

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

@ -95,7 +95,7 @@ Methods defined within this block are _static_, meaning that you can run them be
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).
The `displayName` string is used in debugging messages. JSX sets this value automatically; see [JSX in Depth](/react/docs/jsx-in-depth.html#the-transform).
## Lifecycle Methods

Loading…
Cancel
Save