logo

3.2. React installation

发布时间 :2025-10-25 13:34:29 UTC

Page Views: 17 views

React can be downloaded and used directly, and many learning examples are provided in the download package.

This tutorial uses version 16.4.0 of React. You can download the latest version on the official website https://reactjs.org/ .

You can also use Staticfile CDN’s React CDN library directly at the following address:




   

Official CDN address:

<scriptsrc="https://unpkg.com/react@16/umd/react.development.js">script><scriptsrc="
https://unpkg.com/react-dom@16/umd/react-dom.development.js">
<scriptsrc="https://unpkg.com/babel-standalone@6.15.0/babel.min.js">script>
   

Note: it is very inefficient to use Babel to compile JSX in a browser.

3.2.1. Use an example

The following example outputs Hello, world!

React instance

Hello
React!


ReactDOM.render(

Hello, world!

, document.getElementById('example') );
<p>
 Instance resolution:
</p>
<p>
 In the example, we introduced three libraries:
 <code class="docutils literal notranslate">
  <span class="pre">
   react.development.min.js
  </span>
 </code>
 、
 <code class="docutils literal notranslate">
  <span class="pre">
   react-dom.development.min.js
  </span>
 </code>
 and
 <code class="docutils literal notranslate">
  <span class="pre">
   babel.min.js
  </span>
 </code>
 :
</p>
<ul class="simple">
 <li>
  <p>
   <code class="docutils literal notranslate">
    <span class="pre">
     react.min.js
    </span>
   </code>
   -Core library of React
  </p>
 </li>
 <li>
  <p>
   <code class="docutils literal notranslate">
    <span class="pre">
     react-dom.min.js
    </span>
   </code>
   -provide DOM-related functionality
  </p>
 </li>
 <li>
  <p>
   <code class="docutils literal notranslate">
    <span class="pre">
     babel.min.js
    </span>
   </code>
   -Babel can convert ES6 code to ES5 code so that we can execute React code on currently unsupported ES6 browsers.
   <code class="docutils literal notranslate">
    <span class="pre">
     Babel
    </span>
   </code>
   Embedded support for JSX. By setting the
   <code class="docutils literal notranslate">
    <span class="pre">
     Babel
    </span>
   </code>
   and
   <code class="docutils literal notranslate">
    <span class="pre">
     babel-sublime
    </span>
   </code>
   Package (package) used together can take the syntax rendering of source codeto a whole new level.
  </p>
 </li>
</ul>
<div class="highlight-default notranslate">
 <div class="highlight">
  <pre><span></span>ReactDOM.render(<h1>Hello,world!</h1>,document.getElementById('example'));

The above code inserts an H1 title into the id= “example” node.

Note:

If we need to use JSX, then

Principles, Technologies, and Methods of Geographic Information Systems

 102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.