-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
26 lines (24 loc) · 930 Bytes
/
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
import React from "react";
import ReactDOM from "react-dom";
import { createStore, applyMiddleware } from "redux";
import { Provider } from "react-redux";
import thunk from "redux-thunk";
import { composeWithDevTools } from "redux-devtools-extension";
import rootReducer from "./redux/reducers/rootReducer";
import Search from "./components/Search";
import Details from "./components/Details";
import { BrowserRouter, Route, Switch } from "react-router-dom";
const store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)));
ReactDOM.render(
<BrowserRouter>
<Provider store={store}>
<div>
<Switch>
<Route exact path="/" component={Search} />
<Route exact path="/:entityType/:id/" component={Details} />
</Switch>
</div>
</Provider>
</BrowserRouter>,
document.getElementById("root")
);