shack/renderer/_default.page.client.js

16 lines
329 B
JavaScript
Raw Normal View History

import { createApp } from './app';
async function render(pageContext) {
if (!pageContext.Page) {
throw new Error('Client-side render() hook expects pageContext.Page to be defined');
}
const { app, store } = createApp(pageContext);
store.state.value = pageContext.initialState;
app.mount('#app');
}
export { render };