Primary knowledge Reactjs (I.)

Source: Internet
Author: User

REACTJS website address:http://facebook.github.io/react/

GitHub Address:https://github.com/facebook/react

Eg: Write Reactjs:

It is important to note that react does not rely on jquery, and of course we can use jquery,

But the second parameter in render must use the native JavaScript getElementById method,

You cannot use jquery to select DOM nodes.

1: three-dimensional expression

2: Assigning values to function variables

3: Calling functions Directly

4. Comparison operators

The HTML language is written directly in the JavaScript language without any quotation marks, which is the syntax of JSX, which allows for the mix of HTML and JavaScript, let's look at the code:

Here we declare a names array, and then iterate through the front with the hello, output to the DOM, the output is as follows:

JSX allows JavaScript variables to be inserted directly into the template. If the variable is an array, all the members of the array will be expanded, with the following code:

The results appear as follows:

Primary knowledge Reactjs (I.)

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.