-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
25 lines (22 loc) · 849 Bytes
/
App.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
import React, { Component } from 'react';
//Provider binds react and redux
import { Provider } from 'react-redux';
//createStore creates a store which contains the reducer and state
//to enable Redux Thunk, use applyMiddleware()
import { createStore, applyMiddleware, compose } from 'redux'
//ReduxThunk is a middleware
import thunk from 'redux-thunk';
import reducers from './src/reducers/Index';
import LoginForm from './src/components/LoginForm';
import Router from './src/Router';
export default class App extends React.Component {
render() {
const store = createStore(reducers, {}, compose(applyMiddleware(thunk)));
//the empty object in store is used for so that if we want we can pass any initial state to redux application
return(
<Provider store={store}>
<Router />
</Provider>
)
}
}