0
import React from 'react';
import {render} from 'react-dom';
import Greeter from './Greeter';

import About from './About';
import Repos from './Repos';

import {BrowserRouter as Router,Route,Link} from 'react-router-dom';
import { createBrowserHistory } from 'history'
const history = createBrowserHistory()


const BaseRoutes = () => (
    <Router history={history}>
        <div id="BaseRoutesDiv">
            <Route exact strict path="/" component={Greeter} />
            <Route  path="/about" component={About} />
            <Route  path="/repos" component={Repos} />
        </div>
    </Router>
)
render(<BaseRoutes />,document.getElementById('root'));

2个回答

0

你的打包后空白是什么意思

0

我也碰到跟楼主一样的情况啊 这是我的router 图片描述

这是github上的空白页,貌似router 没起大作用图片描述

该答案已被忽略,原因:

撰写答案

Planets