All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.micronaut.views.react.preact.js Maven / Gradle / Ivy

There is a newer version: 5.5.1
Show newest version
export function ssr(component, props, callback, clientBundleURL) {
    globalThis.Micronaut = {};
    const url = callback.url();
    if (url)
        props = {...props, "url": url};
    const html = renderToString(preact.h(component, props, null))
    callback.write(html)
    const boot = {
        rootProps: props,
        rootComponent: component.name,
    };

    // The Micronaut object defined here is not the same as the Micronaut object defined server side.
    callback.write(``)
    callback.write(`