-
-
Save kasprownik/07c9513272e3857c0cf2 to your computer and use it in GitHub Desktop.
This file contains 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
// src/index.js | |
import React, {PropTypes} from 'react'; | |
import { createStore, applyMiddleware, compose } from 'redux'; | |
import { connect } from 'react-redux'; | |
import { Provider } from 'react-redux'; | |
import thunk from 'redux-thunk'; | |
import createLogger from 'redux-logger'; | |
import Form from './components/Form'; | |
import * as actions from './actions'; | |
import store from './store'; | |
import injectTapEventPlugin from 'react-tap-event-plugin'; | |
injectTapEventPlugin(); | |
const SmartForm = connect(state => state, actions)(Form); | |
const reduxMiddleware = applyMiddleware(thunk, createLogger()); | |
export default props => ( | |
<Provider store={compose(reduxMiddleware)(createStore)(store)}> | |
<SmartForm {...props}/> | |
</Provider> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment