Last active
October 25, 2016 16:15
-
-
Save eLafo/1736bee3664a0ecb1b282b73087a8d9e to your computer and use it in GitHub Desktop.
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
| //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