mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Update React.DOM -> React.createElement through docs
This commit is contained in:
1 parent
0344aaf18d
commit
eb2827ec6a
8 files changed
+13
-13
No files matched your search
@@ -90,14 +90,14 @@ The first thing you'll notice is the XML-ish syntax in your JavaScript. We have
|
||||
var CommentBox = React.createClass({displayName: 'CommentBox',
|
||||
render: function() {
|
||||
return (
|
||||
React.DOM.div({className: "commentBox"},
|
||||
React.createElement('div', {className: "commentBox"},
|
||||
"Hello, world! I am a CommentBox."
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
React.render(
|
||||
CommentBox(null),
|
||||
React.createElement(CommentBox, null),
|
||||
document.getElementById('content')
|
||||
);
|
||||
```
|
||||
@@ -158,7 +158,7 @@ var CommentBox = React.createClass({
|
||||
});
|
||||
```
|
||||
|
||||
Notice how we're mixing HTML tags and components we've built. HTML components are regular React components, just like the ones you define, with one difference. The JSX compiler will automatically rewrite HTML tags to "React.DOM.tagName" expressions and leave everything else alone. This is to prevent the pollution of the global namespace.
|
||||
Notice how we're mixing HTML tags and components we've built. HTML components are regular React components, just like the ones you define, with one difference. The JSX compiler will automatically rewrite HTML tags to `React.createElement(tagName)` expressions and leave everything else alone. This is to prevent the pollution of the global namespace.
|
||||
|
||||
### Component Properties
|
||||
|
||||
|
||||
Reference in new issue
Block a user