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.
#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('example') ); </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!