
React
is a JAVASCRIPT library for building user interfaces.
React
is mainly used to build UI, and many people think
React
isthe V (view) in MVC.
React
an internal project that originated from Facebook and was used to build
Instagram
the website was launched in May 2013.
1.Declarative design 2.Efficient 3.flexible 4.JSX − JSX is an extension of JavaScript syntax. 5.Component − passes through 6.Data flow − of one-way response At the beginning of learning HTML tutorial CSS tutorial JavaScript tutorial ES6 tutorial In each chapter, you can edit the instance online and click the button to view the results. This tutorial uses the Or use the When the browser opens http://localhost:3000/ , it will output:
React
with high performance, the code logic is very simple, more and more people have begun to pay attention to and use it. 3.1.1. Characteristics of React ¶
−React
by using the declaration paradigm, the application can be easily described.
−React
through the simulation of DOM, the interaction with DOM is minimized.
−React
works well with known libraries or frameworks.
React
developers don’t necessarily use JSX, but we recommend it.
React
building components makes the code easier to reuse and can be well applied in the development of large projects.
React
the data flow of one-way response is implemented, thus reducing repetitive code, which is why it is simpler than traditional data binding. 3.1.2. What you need to know before reading this tutorial: ¶
React
before, you need to have the following basic knowledge: 3.1.3. The first instance of React ¶
React
version 16.4.0, you can download the latest version at https://reactjs.org/ .React instance ¶
<divid="example"></div><scripttype="text/babel">ReactDOM.render(<h1>Hello,
world!</h1>, document.getElementById('example') );</script>
create-react-app
tools (described in the next chapter)
react
development environment:Example ¶
import React from "react";
import ReactDOM from "react-dom";
function Hello(props) {
return <h1>Hello World!</h1>;
}
ReactDOM.render(<Hello />, document.getElementById("root"));
Hello World!