Last active
October 4, 2020 12:14
-
-
Save itaditya/19a07eb66642437207a5611f4c91482d to your computer and use it in GitHub Desktop.
(Blog) Build a Redux hooked app
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
// redux.js | |
const enableReduxDevTools = window.__REDUX_DEVTOOLS_EXTENSION__?.(); | |
export function createReduxStore() { | |
const store = createStore(foodReducer, enableReduxDevTools); | |
return store; | |
} | |
// index.js | |
import { Provider } from 'react-redux'; | |
import { createReduxStore } from './redux'; | |
ReactDOM.render( | |
<Provider store={createReduxStore()}> | |
<App /> | |
</Provider>, | |
rootElement, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment