Files
wk-extra/__packages__/www/renderer/_default.page.client.ts
T
2022-05-07 19:28:04 +07:00

15 lines
540 B
TypeScript

import { getPage } from 'vite-plugin-ssr/client'
import { createApp } from './app'
import type { PageContext } from './types'
import type { PageContextBuiltInClient } from 'vite-plugin-ssr/client'
hydrate()
async function hydrate() {
// We do Server Routing, but we can also do Client Routing by using `useClientRouter()`
// instead of `getPage()`, see https://vite-plugin-ssr.com/useClientRouter
const pageContext = await getPage<PageContextBuiltInClient & PageContext>()
const app = createApp(pageContext)
app.mount('#app')
}