create-react-ssr-layout
Version:
A useful tool to quickly build a starting express server that uses custom SSR with a custom jsx render engine
25 lines (23 loc) • 637 B
JSX
import React from 'react';
export default function Layout({ children, initState }) {
return (
<html lang="en">
<head>
<meta charSet="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script defer src="/app.js" />
<script defer src="/vendor.js" />
<script
type="text/javascript"
dangerouslySetInnerHTML={{
__html: `window.initState=${JSON.stringify(initState)}`,
}}
/>
<title>Document</title>
</head>
<body>
<div id="root">{children}</div>
</body>
</html>
);
}