The jsx&react of JavaScript

Source: Internet
Author: User
Tags html tags object model

1.Virtual DOM

1. Map all the content of the Web page to a hierarchical object model of a tree structure, the browser provides support for the DOM, the user can use the script call Dom,api to dynamically modify the DOM node, so as to achieve the purpose of modifying the Web page, this modification is done by the browser, The browser redraws the changed DOM node section according to the DOM's changes 2. The cost of modifying DOM redraw rendering is too high, the front-end frame to improve efficiency, minimize DOm redraw, proposed virtual DOM, all the modifications are made on the Virutal DOM, through the comparison algorithm , to find the difference between browser DOM, using this difference to manipulate the DOM, the browser only needs to render part of the changes can be react implementation of the DOM diff algorithm can effectively compare the virtual DOM and Dom differences

2.JSX syntax

JSX is a JAVASCRI and XML write-down syntax, is the extension of JavaScript JSX specification tag in the first letter lowercase is the HTML tag, the first letter capitalized is the formation of strict requirements of HTML tags, all tags must be closed, BR should Ctrip <br/> Single line omit parentheses, multiple lines use the parentheses element to have multiple lines, build multiple lines, and note the indent JSX expression: use {}, if the curly braces use quotation marks, they are treated as strings

  

  

The jsx&react of JavaScript

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.