This commit is contained in:
SleepWalker 2016-09-10 13:58:57 +03:00
parent 4e7980a175
commit b746a4967b

View File

@ -1,20 +1,26 @@
import 'babel-polyfill';
import ReactDOM from 'react-dom';
import ReactDOMServer from 'react-dom/server';
import App from 'App';
// NOTE: we are requiring with require(), to enable dynamic dependencies
// depending on ENV, where App is running in.
// This allows us better support of hmr and reduces bundle size
/* global process: false */
// eslint-disable-next-line no-negated-condition
if (process.env.NODE_ENV !== 'production') {
const ReactDOM = require('react-dom');
const DevApp = require('devTools').default;
ReactDOM.render(
<DevApp />,
document.getElementById('app')
);
}
} else {
const ReactDOMServer = require('react-dom/server');
const App = require('App').default;
export default function(props) {
module.exports = {
default(props) {
return ReactDOMServer.renderToStaticMarkup(<App {...props} />);
}
};
}