iles
Version:
Vite & Vue powered static site generator with partial hydration
10 lines (9 loc) • 351 B
JavaScript
import { useSSRContext } from 'vue';
export function useRenderer(framework) {
const context = useSSRContext();
if (!context)
throw new Error('SSR context not found when rendering islands.');
if (!context.renderers)
throw new Error('Island renderers are missing in SSR context.');
return context.renderers[framework];
}