migrated to vite and vite-plugin-ssr

This commit is contained in:
Ren Amamiya
2023-04-22 17:56:09 +07:00
parent c50e507c14
commit b9bafc851e
67 changed files with 911 additions and 1060 deletions

View File

@@ -0,0 +1,20 @@
import '@renderer/index.css';
import { Shell } from '@renderer/shell';
import { PageContextClient } from '@renderer/types';
import { hydrateRoot } from 'react-dom/client';
export const clientRouting = true;
export async function render(pageContext: PageContextClient) {
const { Page, pageProps } = pageContext;
if (!Page) throw new Error('Client-side render() hook expects pageContext.Page to be defined');
hydrateRoot(
document.getElementById('app')!,
<Shell pageContext={pageContext}>
<Page {...pageProps} />
</Shell>
);
}