mirror of
https://github.com/elyby/emails-renderer.git
synced 2024-12-22 13:19:45 +05:30
Fix hmr
This commit is contained in:
parent
4e7980a175
commit
b746a4967b
20
src/index.js
20
src/index.js
@ -1,20 +1,26 @@
|
|||||||
import 'babel-polyfill';
|
import 'babel-polyfill';
|
||||||
|
|
||||||
import ReactDOM from 'react-dom';
|
// NOTE: we are requiring with require(), to enable dynamic dependencies
|
||||||
import ReactDOMServer from 'react-dom/server';
|
// depending on ENV, where App is running in.
|
||||||
|
// This allows us better support of hmr and reduces bundle size
|
||||||
import App from 'App';
|
|
||||||
|
|
||||||
/* global process: false */
|
/* global process: false */
|
||||||
|
// eslint-disable-next-line no-negated-condition
|
||||||
if (process.env.NODE_ENV !== 'production') {
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
|
const ReactDOM = require('react-dom');
|
||||||
const DevApp = require('devTools').default;
|
const DevApp = require('devTools').default;
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<DevApp />,
|
<DevApp />,
|
||||||
document.getElementById('app')
|
document.getElementById('app')
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
|
const ReactDOMServer = require('react-dom/server');
|
||||||
|
const App = require('App').default;
|
||||||
|
|
||||||
export default function(props) {
|
module.exports = {
|
||||||
return ReactDOMServer.renderToStaticMarkup(<App {...props} />);
|
default(props) {
|
||||||
|
return ReactDOMServer.renderToStaticMarkup(<App {...props} />);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user