markdown 34 - 了解React的DOM更新策略

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 34 - 了解React的DOM更新策略相关的知识,希望对你有一定的参考价值。

- render() does not immediately render content to the DOM, more a suggestion of what the HTML should look like
- even if a prop does change and we should render the same result, render does not immediately hit the real dom and start rerendering
- it compares virtual DOMs first (old virtual DOM vs re-rendered i.e. futured virtual DOM)
- virtual DOM approach faster than the real DOM
- a DOM representenation in JavaScript. def: virtual DOM
- re-rendered dom gets created when the render() method is called - doesn't immediately update
- makes the comparision and checks for differences
- even then, react only updates the DOM in places where it has been changed
- if no differences were found, the real DOM is not touched
- accessing the DOM is very slow
- react makes sure the DOM is only touched when absolutely necessary

以上是关于markdown 34 - 了解React的DOM更新策略的主要内容,如果未能解决你的问题,请参考以下文章

react 中 JSX 语法的转化过程

react 中 JSX 语法的转化过程

markdown php同时与do-while

自己动手写编译器:while,for,do等循环语句的中间代码生成

自己动手写编译器:while,for,do等循环语句的中间代码生成

markdown Comandos do Zypper,gerenciador de pacotes。