16 lines
329 B
JavaScript
16 lines
329 B
JavaScript
|
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 };
|