Created
November 28, 2020 16:56
-
-
Save LanciWeb/55d119877b717c020d9ba11fd86c45ac to your computer and use it in GitHub Desktop.
Wiring up redux thunk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import App from './App'; | |
| import { createStore, applyMiddleware } from 'redux'; //applyMiddleware comes from redux | |
| import { Provider } from 'react-redux'; | |
| import reducers from './reducers'; | |
| import thunk from 'redux-thunk'; | |
| const store = createStore(combinedReducers, applyMiddleware(thunk)); //applyMuddleware adds thunk to the store | |
| ReactDOM.render( | |
| <Provider store={store}> | |
| <App /> | |
| </Provider>, | |
| document.getElementById('root') | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment