-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
49 lines (41 loc) · 1.29 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
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import { Provide } from "react-redux";
import { Route, hashHistory } from "react-router";
import { BrowserRouter } from "react-router-dom";
import { Switch } from "react-router-dom";
import FormSearch from "./FormSearch";
import { Link, Router } from "react-router";
import { Provider } from "react-redux";
import { HashRouter } from "react-router-dom";
import { createStore, applyMiddleware } from "redux";
import { composeWithDevTools } from "redux-devtools-extension";
import thunk from "redux-thunk";
import App from "./App";
import "./index.css";
import reducer from "./reducers";
import About from "./About";
const store = createStore(reducer, composeWithDevTools(applyMiddleware(thunk)));
console.log(store.getState());
const Main = () => (
<main>
<Switch>
<Route exact path="/" component={App} />
<Route path="/about" component={About} />
<Route path="/FormSearch" component={FormSearch} />
</Switch>
</main>
);
<Router history={HashRouter}>
<Route path="/" component={App}/>
<Router path="/about" component={About}/>
</Router>
ReactDOM.render(
<Provider store={store}>
<BrowserRouter>
<Main />
</BrowserRouter>
</Provider>,
document.getElementById("root")
);