mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-22 08:58:55 +00:00
Minimal HMR (#294)
* Move Root Component to root level * remove Root export from components directory * support Root HMR
This commit is contained in:
parent
edf7e36836
commit
d9ea80fd43
@ -1,6 +1,5 @@
|
||||
export { default as Header } from './Header';
|
||||
export { default as Footer } from './Footer';
|
||||
export { default as Root } from './Root';
|
||||
export { default as BalanceSidebar } from './BalanceSidebar';
|
||||
export { default as PaperWallet } from './PaperWallet';
|
||||
export { default as AlphaAgreement } from './AlphaAgreement';
|
||||
|
@ -3,20 +3,23 @@ import 'assets/styles/etherwallet-master.less';
|
||||
import 'font-awesome/scss/font-awesome.scss';
|
||||
import React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import { Root } from './components';
|
||||
import Root from './Root';
|
||||
import createHistory from 'history/createBrowserHistory';
|
||||
import { configuredStore } from './store';
|
||||
import 'sass/styles.scss';
|
||||
|
||||
const history = createHistory();
|
||||
|
||||
render(
|
||||
<Root store={configuredStore} history={history} />,
|
||||
document.getElementById('app')
|
||||
);
|
||||
const appEl = document.getElementById('app');
|
||||
|
||||
render(<Root store={configuredStore} history={history} />, appEl);
|
||||
|
||||
if (module.hot) {
|
||||
module.hot.accept('reducers', () =>
|
||||
configuredStore.replaceReducer(require('reducers'))
|
||||
);
|
||||
|
||||
module.hot.accept('./Root', () => {
|
||||
render(<Root store={configuredStore} history={history} />, appEl);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user