-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (19 loc) · 718 Bytes
/
index.js
File metadata and controls
23 lines (19 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import React from 'react';
import ReactDOM from 'react-dom';
import Home from "./component/Home";
import Upload from "./component/Upload";
import {BrowserRouter,Switch, Route, Redirect} from 'react-router-dom'
const router=
<BrowserRouter basename="/Local-File-Server">
<Switch>
<Route exact path="/">
<Redirect to="/home"/>
</Route>
<Route path="/home" component={Home} title={"Home"}/>
<Route path="/upload" component={Upload} title={"Profile"}/>
<Route path="*">
<Redirect to={"/home"}/>
</Route>
</Switch>
</BrowserRouter>;
ReactDOM.render(router, document.getElementById('root'));