Home  >  Article  >  Web Front-end  >  How to use react

How to use react

coldplay.xixi
coldplay.xixiOriginal
2020-11-16 11:15:213588browse

Usage of react: 1. JAVASCRIPT library used to build user interface; 2. Used to build UI; 3. Used to set up Instagram website; 4. It has high performance and the code logic is very simple.

How to use react

#React

  • React is a JAVASCRIPT library for building user interfaces.

  • React is mainly used to build UI. Many people think that React is the V (view) in MVC.

  • #React originated as an internal project at Facebook and was used to build the Instagram website, and was open sourced in May 2013.

  • React has high performance and very simple code logic. More and more people have begun to pay attention to and use it.

#React Features

1. Declarative design −React adopts a declarative paradigm, which makes it easy to describe applications.

2. Efficiency −React minimizes interaction with the DOM by simulating the DOM.

3. Flexible −React works well with known libraries or frameworks.

4.JSX − JSX is an extension of JavaScript syntax. JSX is not required for React development, but it is recommended.

5. Components − Building components through React makes it easier to reuse code and can be well applied in the development of large projects.

6. One-way response data flow − React implements one-way response data flow, thereby reducing duplicate code, which is why it is simpler than traditional data binding.

What you need to know before reading this tutorial:

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

  • HTML5

  • CSS

  • JavaScript

##React First Example

React Example

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

Related free learning recommendations:

JavaScript (video)

The above is the detailed content of How to use react. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to get data in reactNext article:How to get data in react