Files
react.dev/docs/ref-07-special-non-dom-attributes.md
Vjeux 0f3a5793e5 Document the Diff algorithm
We often refer to it but never did actually explain it.
2013-12-22 20:09:02 +01:00

871 B

id, title, layout, permalink, prev, next
id title layout permalink prev next
special-non-dom-attributes Special Non-DOM Attributes docs special-non-dom-attributes.html dom-differences.html reconciliation.html

Beside DOM differences, 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.
  • ref: see here.
  • 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.