Skip to content

Instantly share code, notes, and snippets.

@kasprownik
Last active January 29, 2016 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasprownik/07c9513272e3857c0cf2 to your computer and use it in GitHub Desktop.
Save kasprownik/07c9513272e3857c0cf2 to your computer and use it in GitHub Desktop.
// 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