Skip to content

Instantly share code, notes, and snippets.

@jakejrichards
Created May 26, 2019 19:45
Show Gist options
  • Save jakejrichards/99c7078f9239f2c051f320f5e0fe1457 to your computer and use it in GitHub Desktop.
Save jakejrichards/99c7078f9239f2c051f320f5e0fe1457 to your computer and use it in GitHub Desktop.
import React from 'react';
import ReactDOM from 'react-dom';
import { applyMiddleware, createStore } from 'redux';
import thunk from 'redux-thunk';
import { Provider } from 'react-redux';
import reducer, { initialState } from './store/reducer';
import App from './components/App';
// If you are interested in using the redux devtools
import { composeWithDevTools } from 'redux-devtools-extension';
const composeEnhancers = composeWithDevTools({});
const store = createStore(reducer, initialState, composeEnhancers(applyMiddleware(thunk)));
const ConnectedApp = () => (
<Provider store={store}>
<App />
</Provider>
);
ReactDOM.render(<ConnectedApp />, document.getElementById('root'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment