mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Update 02.2-jsx-gotchas.md
This commit is contained in:
@@ -52,28 +52,6 @@ As a last resort, you always have the ability to insert raw HTML.
|
||||
<div dangerouslySetInnerHTML={{'{{'}}__html: 'First · 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
|
||||
|
||||
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-`.
|
||||
|
||||
Reference in New Issue
Block a user