refactored

This commit is contained in:
Sean Macfarlane
2020-03-11 17:55:42 -04:00
parent 63b392d73d
commit b619cfe8b0
31 changed files with 836 additions and 261 deletions

View File

@@ -1,24 +1,30 @@
import React from 'react';
import { render } from 'react-dom';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { ConnectedRouter } from 'react-router-redux';
import { ConnectedRouter } from 'connected-react-router';
import App from 'containers/App';
import store from 'store';
import configureStore from 'store';
import history from 'utils/history';
const renderApp = () =>
render(
// Create redux store with history
const initialState = {};
const store = configureStore(initialState, history);
const MOUNT_NODE = document.getElementById('root');
const render = () => {
ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<App />
</ConnectedRouter>
</Provider>,
document.getElementById('root')
MOUNT_NODE
);
};
if (process.env.NODE_ENV !== 'production' && module.hot) {
module.hot.accept('containers/App', renderApp);
module.hot.accept('containers/App', () => ReactDOM.unmountComponentAtNode(MOUNT_NODE));
}
renderApp();
render();