Browse Source

Update 02.2-jsx-gotchas.md

main
Pete Hunt 12 years ago
committed by petehunt
parent
commit
c1bf5a8a81
  1. 22
      docs/refactor/02.2-jsx-gotchas.md

22
docs/refactor/02.2-jsx-gotchas.md

@ -52,28 +52,6 @@ As a last resort, you always have the ability to insert raw HTML.
<div dangerouslySetInnerHTML={{'{{'}}__html: 'First &middot; Second'}} /> <div dangerouslySetInnerHTML={{'{{'}}__html: 'First &middot; Second'}} />
``` ```
## Comments
JSX supports both single-line and multi-line JavaScript comments within a tag declaration:
```javascript
<div // This is a single-line comment:
/*
And a multi-line
comment
*/
/>
```
As of React 0.3, there is no good way to insert comments within the children section. [Issue #82](https://github.com/facebook/react/issues/82) is tracking progress to enable the following:
```javascript
// Note: This is not implemented yet!
<div>
{/* This is a comment */}
</div>
```
## Custom HTML Attributes ## Custom HTML Attributes
If you pass properties to native HTML elements that do not exist in the HTML specification, React will not render them. If you want to use a custom attribute, you should prefix it with `data-`. If you pass properties to native HTML elements that do not exist in the HTML specification, React will not render them. If you want to use a custom attribute, you should prefix it with `data-`.

Loading…
Cancel
Save