Streamline home page
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import React from 'react';
|
||||
import ReactDOMServer from 'react-dom/server';
|
||||
import { StaticRouter } from 'react-router-dom';
|
||||
|
||||
import MainTemplate from '../client/MainTemplate';
|
||||
import MainApp from '../client/main/App';
|
||||
@ -9,12 +8,9 @@ import getEntryPoints from '../utils/getEntryPoints';
|
||||
import renderTemplate from '../utils/renderTemplate';
|
||||
|
||||
export default function serveMainPage(req, res) {
|
||||
const element = React.createElement(
|
||||
StaticRouter,
|
||||
{ location: req.url },
|
||||
React.createElement(MainApp)
|
||||
const content = createHTML(
|
||||
ReactDOMServer.renderToString(React.createElement(MainApp))
|
||||
);
|
||||
const content = createHTML(ReactDOMServer.renderToString(element));
|
||||
|
||||
const entryPoints = getEntryPoints('main', {
|
||||
es: 'module',
|
||||
|
Reference in New Issue
Block a user