Server render the main page

Also, add hashes to asset file names and use the "entry manifest" plugin
in dev to get auto-reloading.
This commit is contained in:
Michael Jackson
2019-01-12 19:27:28 -08:00
parent 45c48cba26
commit 09914c1db4
176 changed files with 2725 additions and 119822 deletions

View File

@ -1,10 +1,26 @@
// import './autoIndex.css';
import React from 'react';
import ReactDOM from 'react-dom';
import { Global, css } from '@emotion/core';
import App from './autoIndex/App';
const globalStyles = css`
body {
font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Helvetica, Arial, sans-serif;
line-height: 1.7;
padding: 0px 10px 5px;
color: #000000;
}
`;
const props = window.__DATA__ || {};
ReactDOM.hydrate(<App {...props} />, document.getElementById('root'));
ReactDOM.hydrate(
<div>
<Global styles={globalStyles} />
<App {...props} />
</div>,
document.getElementById('root')
);