Also, add hashes to asset file names and use the "entry manifest" plugin in dev to get auto-reloading.
12 lines
281 B
JavaScript
12 lines
281 B
JavaScript
import React from 'react';
|
|
import ReactDOMServer from 'react-dom/server';
|
|
|
|
const doctype = '<!DOCTYPE html>';
|
|
|
|
export default function renderTemplate(component, props) {
|
|
return (
|
|
doctype +
|
|
ReactDOMServer.renderToStaticMarkup(React.createElement(component, props))
|
|
);
|
|
}
|