Skip to content

Instantly share code, notes, and snippets.

@eLafo
Last active October 25, 2016 16:15
Show Gist options
  • Select an option

  • Save eLafo/1736bee3664a0ecb1b282b73087a8d9e to your computer and use it in GitHub Desktop.

Select an option

Save eLafo/1736bee3664a0ecb1b282b73087a8d9e to your computer and use it in GitHub Desktop.
//index.js
import React from 'react';
import ReactDOM from 'react-dom';
import {Provider} from 'react-redux';
import { createStore } from 'redux';
import AppContainer from './app/containers/AppContainer';
import todoApp from './rootReducer';
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();
//1. we create the store and tell it which root reducer to use
let store = createStore(todoApp);
//2. We create the root component and connect the store to the components
// From now on container components can connect to the store using connect()
ReactDOM.render(
<Provider store={store}>
<AppContainer />
</Provider>,
document.getElementById('app')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment