install and use redux to fetch data from server
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user