import React from 'react';
import ReactDOM from 'react-dom';
import {HashRouter as Router,Route} from 'react-router-dom';
import Home from './components/Home';
import User from './components/User';
import Profile from './components/Profile';
/***
* Router 是路由容器,放在最外层
* Route 代表路由配置 当前地址栏的路径是path,就渲染component
* 匹配的path是前缀,url是以path开头的 /user exact不在匹配前缀了,而是精确匹配,看是否完全相等。
* router配置有三种方式 1、手工代码 2、约定试 umi 3.配置式 routes.js ant design pro
*/
ReactDOM.render(
<Router>
<>
<Route exact path="/" component={Home} />
<Route path="/user" component={User} />
<Route path="/profile" component={Profile} />
</>
</Router>,
document.getElementById('root')
);