Skip to content

Instantly share code, notes, and snippets.

@nitaliano
Created April 6, 2016 19:49
Show Gist options
  • Save nitaliano/abec54af27b8d1cc832a68669be8ebb7 to your computer and use it in GitHub Desktop.
Save nitaliano/abec54af27b8d1cc832a68669be8ebb7 to your computer and use it in GitHub Desktop.
import React from 'react';
import ReactDOM from 'react-dom';
import configureStore from './store';
import routes from './routes';
import { Provider } from 'react-redux';
import { Router, browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
window.addEventListener('DOMContentLoaded', () => {
const $el = document.getElementById('app');
const store = configureStore();
const history = syncHistoryWithStore(browserHistory, store);
ReactDOM.render(
<Provider store={store}>
<Router history={history} routes={routes} />
</Provider>, $el);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment