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