Skip to main content

PreviewScript

Function PreviewScript 

Source
pub fn PreviewScript() -> Element
Expand description

Injects the WebGL2 preview renderer script once into the page.

Render this exactly once, typically as the last child of your root component. Every StreamPreview in the DOM is discovered and driven by this script; without it the preview canvases stay blank.

Equivalent to:

rsx! { script { dangerous_inner_html: "{PREVIEW_JS}" } }