-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
26 lines (23 loc) · 856 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 './index.css';
import App from './components/App';
import {BrowserRouter, Switch, Route} from 'react-router-dom';
import registerServiceWorker from './registerServiceWorker';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import rootReducer from './reducers';
import FavoriteRecipeList from './components/FavoriteRecipeList';
const store = createStore(rootReducer);
store.subscribe(() => console.log('store',store.getState()));
ReactDOM.render(
<Provider store={store}>
<BrowserRouter>
<Switch>
<Route exact path='/' component={App} />
<Route path='/favorites' component={FavoriteRecipeList} />
</Switch>
</BrowserRouter>
</Provider>
, document.getElementById('root'));
registerServiceWorker();