MyCrypto/common/index.jsx
William O'Beirne b59298ec0e Hot module reload fixes (#181)
* accept hot module changes, move routes into root component

* Fix "You cannot change <Router routes>; it will be ignored" error message by implementing solution in Github: https://github.com/ReactTraining/react-router/issues/2704#issuecomment-211352123

Router is only instantiated once in a production setting (e.g. not webpack-dev-server), so there is minimal overhead on producing a random key value for `Router`.
2017-09-08 11:57:50 -05:00

30 lines
788 B
JavaScript

// Application styles must come first in order, to allow for overrides
import 'assets/styles/etherwallet-master.less';
import 'font-awesome/scss/font-awesome.scss';
import 'sass/styles.scss';
import React from 'react';
import { render } from 'react-dom';
import { syncHistoryWithStore } from 'react-router-redux';
import { Root } from 'components';
import { history } from './routing';
import { store } from './store';
const renderRoot = Root => {
let syncedHistory = syncHistoryWithStore(history, store);
render(
<Root history={syncedHistory} store={store} />,
document.getElementById('app')
);
};
renderRoot(Root);
if (module.hot) {
module.hot.accept('reducers/index', () =>
store.replaceReducer(require('reducers/index').default)
);
module.hot.accept();
}