io.micronaut.views.react.preact.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micronaut-views-react Show documentation
Show all versions of micronaut-views-react Show documentation
Provides integration between Micronaut and server-side views technologies
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(`