This repository has been archived by the owner on Aug 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
55 lines (48 loc) · 1.45 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter, Route, Switch} from 'react-router-dom';
import './index.css';
import App from './App';
import User from './extras/components/User';
import {Provider} from "react-redux";
//import recipientReducer from "./reducers/recipient-reducer";
//import destinationReducer from "./reducers/destination-reducer"
//import amountReducer from "./reducers/amount-reducer"
import NotFound from './extras/NotFound';
import registerServiceWorker from './registerServiceWorker';
import store from './store';
let mPoint = document.getElementById('root');
var mainComponent = ()=>{
return(
<Provider store={store}>
<App />
</Provider>
)
}
var UserComponent = ()=>{
return(
<Provider store={store}>
<User />
</Provider>
)
}
var Root = ()=>{
return(
<BrowserRouter basename = "/" >
<div className="main">
<Switch>
<Route exact path="/" component={ mainComponent } />
<Route exact path="/login" component={ UserComponent } />
<Route exact path="/user" component={ UserComponent } />
<Route component={ NotFound } />
</Switch>
</div>
</BrowserRouter>
)
}
// store.dispatch(action)
// console.log(store.getState())
ReactDOM.render(
<Root/>, mPoint
);
registerServiceWorker();