mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
docs section for non-dom attributes
Also added documentation for `dangerouslySetInnerHTML`.
This commit is contained in:
@@ -55,3 +55,5 @@
|
|||||||
title: Event System
|
title: Event System
|
||||||
- id: dom-differences
|
- id: dom-differences
|
||||||
title: DOM Differences
|
title: DOM Differences
|
||||||
|
- id: special-non-dom-attributes
|
||||||
|
title: Special Non-DOM attributes
|
||||||
|
|||||||
@@ -57,7 +57,9 @@ rowSpan scrollLeft scrollTop selected size spellCheck src step style tabIndex
|
|||||||
target title type value width wmode
|
target title type value width wmode
|
||||||
```
|
```
|
||||||
|
|
||||||
In addition, the non-standard `autoCapitalize` attribute is supported for Mobile Safari.
|
The non-standard `autoCapitalize` attribute is supported for Mobile Safari.
|
||||||
|
|
||||||
|
In addition, there is the React-specific attribute `dangerouslySetInnerHTML` ([more here](/react/docs/special-non-dom-attributes.html)), used for directly inserting DOM strings into a component.
|
||||||
|
|
||||||
### SVG Attributes
|
### SVG Attributes
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ title: DOM Differences
|
|||||||
layout: docs
|
layout: docs
|
||||||
permalink: dom-differences.html
|
permalink: dom-differences.html
|
||||||
prev: events.html
|
prev: events.html
|
||||||
|
next: special-non-dom-attributes.html
|
||||||
---
|
---
|
||||||
|
|
||||||
React has implemented a browser-independent events and DOM system for performance and cross-browser compatibility reasons. We took the opportunity to clean up a few rough edges in browser DOM implementations.
|
React has implemented a browser-independent events and DOM system for performance and cross-browser compatibility reasons. We took the opportunity to clean up a few rough edges in browser DOM implementations.
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
id: special-non-dom-attributes
|
||||||
|
title: Special Non-DOM Attributes
|
||||||
|
layout: docs
|
||||||
|
permalink: special-non-dom-attributes.html
|
||||||
|
prev: dom-differences.html
|
||||||
|
---
|
||||||
|
|
||||||
|
Beside [DOM differences](/react/docs/dom-differences.html), React offers some attributes that simply don't exist in DOM.
|
||||||
|
|
||||||
|
- `key`: an optional, unique identifier. When your component shuffles around during `render` passes, it might be destroyed and recreated due to the diff algorithm. Assigning it a key that persists makes sure the component stays. See more [here](/react/docs/multiple-components.html#dynamic-children).
|
||||||
|
- `ref`: see [here](/react/docs/more-about-refs.html).
|
||||||
|
- `dangerouslySetInnerHTML`: takes an object with the key `__html` and a DOM string as value. This is mainly for cooperating with DOM string manipulation libraries. Refer to the last example on the front page.
|
||||||
Reference in New Issue
Block a user