虚拟DOM

Another notable feature is the use of a "virtual Document Object Model", or "virtual DOM". React creates an in-memory data structure cache, computes the resulting differences, and then updates the browser's displayed DOM efficiently.[14] This allows the programmer to write code as if the entire page is rendered on each change, while the React libraries only render sub components that actually change.

天生就慢的 DOM

从 JSX 到 DOM

在表达树形结构时,XML 风格的语法要比 JavaScript 的多层对象表达方式清晰地多。