public/index.html 中引入样式时不写./写/
<link rel="stylesheet" href="/css/bootstrap.css">
public/index.html 中引入样式时不写./写%PUBLIC_URL%/
<link rel="stylesheet" href="%PUBLIC_URL%/css/bootstrap.css">
使用HashRouter
import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter } from "react-router-dom";
import './index.css';
import App from './App';
ReactDOM.render(
<HashRouter>
<App/>
</HashRouter>,
document.getElementById('root')
)