Reactjs Getting Started---writing Hello world

Source: Internet
Author: User

React originated in Facebook's internal project because the company was dissatisfied with all the JavaScript MVC frameworks on the market and decided to write a set of Web sites that would be used to erect Instagram. After doing it, found that this set of things very useful, in May 2013, open source. Because React's design ideas are extremely unique, revolutionary and innovative, the code logic is simple. Therefore, more and more people are beginning to pay attention to and use, think it may be the mainstream tool of WEB development in the future.

  Below is a small case react getting started--hello world

Reactjs download is very simple, in order to facilitate everyone to download, here again to give (link), after the download is complete, I see is a compressed package. After extracting, we create a new HTML file that references the two JS files of React.js and Jsxtransformer.js. The HTML template is as follows (the JS path is changed to its own):

Here you may wonder why the type of script is TEXT/JSX, because React's unique JSX syntax is incompatible with JavaScript . wherever the use of JSX, all should add Type= "TEXT/JSX". Second, React provides two libraries: React.js and Jsxtransformer.js, which must be loaded first. Among them, the role of Jsxtransformer.js is to convert JSX syntax to JavaScript syntax. This step is very time consuming, in fact the line should be put on the server to complete.

So we can write the JS code.

React.render is the most basic method of React for converting a template to an HTML language and inserting a specified DOM node.

So we can see hello,world! in the browser. , it is important to note that some browsers (such as Chrome) will not be able to load the file unless it passes through the HTTP service.

Here, congratulations, you have entered the gate of Reactjs ~ ~

Reactjs Getting Started---writing Hello world

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.