reactjs

如何安装reactjs

日期:2019-06-25 阅读:791

dmandwp系统 - wordpress系统和DM系统区块建站>>

直接引用 https://raw.githubusercontent.com/reactjs/reactjs.org/master/static/html/single-file-example.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Hello World</title>
    <script src="https://unpkg.com/react@16/umd/react.development.js"></script>
    <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
    
    <!-- Don't use this in production: -->
    <script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
  </head>
  <body>
    <div id="root"></div>
    <script type="text/babel">

      ReactDOM.render(
        <h1>Hello, world!</h1>,
        document.getElementById('root')
      );

    </script>
 
  </body>
</html>

-----------------------

也可以通过npm安装

npx create-react-app my-app
cd my-app
npm start

npm run build

或者:

npm install -g create-react-app

https://www.npmjs.com/package/create-react-app

https://create-react-app.dev/

--------

https://reactjs.org/docs/create-a-new-react-app.html#create-react-app
 
https://www.npmjs.com/package/create-react-app

 

--------------------

 

<<点击返回