@samitouri / QOS-React-2 / commits / 2184162e38

Add documentation about JSX and displayName. The section that described how JSX transform handles displayName was lost in commit 9b1ee4de4636fcc9af1cf93099e062a3f6eb96f5

Add documentation about JSX and displayName. The section that described how JSX transform handles displayName was lost in commit 9b1ee4de4636fcc9af1cf93099e062a3f6eb96f5 Fixes #3338

Rick Beerendonk committed Mar 7, 2015 at 19:01 UTC 2184162e38803be7a442e2d331bdfa952a4aa2aa
2 files changed +10 -1
docs/docs/02.1-jsx-in-depth.md
+9
@@ -73,6 +73,15 @@ var app = React.createElement(
73 );
74 ```
75
76 +JSX will infer the class's [displayName](/react/docs/component-specs.html#displayName) from the variable assignment when the displayName is undefined:
77 +
78 +```javascript
79 +// Input (JSX):
80 +var Nav = React.createClass({ });
81 +// Output (JS):
82 +var Nav = React.createClass({displayName: "Nav", });
83 +```
84 +
85 Use the [JSX Compiler](/react/jsx-compiler.html) to try out JSX and see how it
86 desugars into native JavaScript, and the
87 [HTML to JSX converter](/react/html-jsx.html) to convert your existing HTML to
docs/docs/ref-03-component-specs.md
+1 -1
@@ -95,7 +95,7 @@ Methods defined within this block are _static_, meaning that you can run them be
95 string displayName
96 ```
97
98 -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).
98 +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).
99
100
101 ## Lifecycle Methods