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.