React tutorial

React tutorial

React is a JAVASCRIPT library for building user interfaces.

React is primarily used to build UI, and many people think of React as a V (view) in MVC.

React originated from Facebook's in-house project to set up Instagram and was opened in May 2013.

React has high performance, the code logic is very simple, and more and more people are starting to pay attention to and use it.



React features

  • 1. Declarive Design - React uses a declaration paradigm that makes it easy to describe an application.

  • 2. Efficiency - React minimizes interaction with the DOM by simulating it.

  • 3. Flexible - React works well with known libraries or frameworks.

  • 4.JSX - JSX is an extension of the JavaScript syntax. React development does not necessarily use JSX, but we recommend using it.

  • 5. Components - Build components with React to make code easier to use and can be well used in the development of large projects.

  • 6. One-way response data flow - React implements one-way response traffic, which reduces duplicate code, which is why it is simpler than traditional data binding.


What you need to know before you read this tutorial:

Before you start learning React, you need to have the following basics:


React's first instance

In each chapter, you can edit the instance online and click the button to see the results.

This tutorial uses react version 0.14.7, and you can download the latest version http://facebook.github.io/react/ website.

React instance

<div id="example"></div>
<script type="text/babel">
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('example')
);
</script>

Try it out . . .