プレイグラウンド、サンドボックス、使い捨てスクリプト置き場
0

Configure Feed

Select the types of activity you want to include in your feed.

refactor

Kohei Watanabe (Oct 13, 2021, 7:50 PM +0900) db8b7490 254efe47

+8 -6
+8 -6
vite-ssg/renderer/_default.page.server.tsx
··· 3 3 import type { PageContextBuiltIn } from "vite-plugin-ssr/types"; 4 4 5 5 export async function render(pageContext: PageContextBuiltIn) { 6 - const { Page } = pageContext; 7 - const html = renderToString(<Page />); 8 - 9 - return escapeInject`<!DOCTYPE html> 6 + const html = renderToString( 10 7 <html> 11 8 <head> 12 9 <title>vite-ssg-example</title> 13 10 </head> 14 - <body>${dangerouslySkipEscape(html)}</body> 15 - </html>`; 11 + <body> 12 + <pageContext.Page /> 13 + </body> 14 + </html> 15 + ); 16 + 17 + return escapeInject`<!DOCTYPE html>${dangerouslySkipEscape(html)}`; 16 18 }