How to develop non-single-page applications with React + Antd (non-spa)

when I first come into contact with React and Antd, most of them use webpack to generate spa single-page applications and use routing to achieve multiple pages.
this kind of application URL implementation is a page, and I want to develop that kind of non-spa application.
is still the original traditional url.
such as

http://xxx.com/news/1.html
http://xxx.com/news/2.html

instead of

http://xxx.com/-sharp/1
http://xxx.com/-sharp/2

how to achieve this?

Mar.05,2021

use react-router 4
the following is a multi-page application, divided into home page and login page, the home page is a single page application


this can be used after testing.

<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
  <title>Antd</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.3.2/umd/react.production.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.3.2/umd/react-dom.production.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.min.js"></script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/antd/3.4.3/antd.min.css" />
  <script src="https://cdnjs.cloudflare.com/ajax/libs/antd/3.4.3/antd.min.js"></script>
</head>

<body>
  <div id="message1">xx</div>
  <script type="text/babel" src="button.js"></script>
</body>

</html>

button.js

// import { Button, Radio, Icon } from 'antd';
ReactDOM.render(
  <div>
    <antd.Button type="primary">Primary</antd.Button>
    <antd.Button>Default</antd.Button>
    <antd.Button type="dashed">Dashed</antd.Button>
    <antd.Button type="danger">Danger</antd.Button>
    <antd.Input placeholder="Basic usage" />
    <antd.Switch defaultChecked />
    <antd.TimePicker defaultOpenValue={moment('00:00:00', 'HH:mm:ss')} />
  </div>
, document.getElementById('message1'));

happens to think of a project I did earlier demo
you can refer to.
in addition, we also have an initialization to implement the initial project for reference.


React itself is a simple view layer implementation, and later, in order to make full use of the advantages of react, it is equipped with the surrounding technology stack redux, webpack, routing and so on to implement SPA. Of course,
can also be the kind of implementation you want, maintaining the previous development style. All you have to do is reference react, the js library, in each html.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>first</title>
</head>
<body>
    <div id="main">

    </div>

    <script src="../react15.6.1.min.js"></script>
    <script src="../react-dom15.6.1.min.js"></script>
    <script src="../browser.min.js"></script>
    <script type="text/babel" src="./hello.js"></script>
</body>
</html>

this can directly achieve what you want.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1beb225-31a3d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1beb225-31a3d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?