install and use redux to fetch data from server

This commit is contained in:
Bilal Catic
2019-05-28 04:39:50 +02:00
parent 0100f15960
commit 6cc3643501
9 changed files with 124 additions and 8 deletions

View File

@@ -4,8 +4,14 @@ import './index.css';
import 'semantic-ui-css/semantic.min.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import thunkMiddleware from 'redux-thunk';
import { rootReducer } from "./store/reducers";
ReactDOM.render(<App />, document.getElementById('root'));
const store = createStore(rootReducer, applyMiddleware(thunkMiddleware));
ReactDOM.render(<Provider store={store}><App /></Provider>, document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.