Closed tv42 closed 1 year ago
The SSR renderer only outputs what should rendered inside of the main div. If you want to add <!DOCTYPE html>
you can add it to the front of the output of the output of ssr.
use dioxus::prelude::*;
fn main() {
let mut vdom = VirtualDom::new(app);
let _ = vdom.rebuild();
let full_html = format!("<!DOCTYPE html>{}", dioxus_ssr::pre_render(&vdom));
println!("{}", full_html);
}
fn app(cx: Scope) -> Element {
cx.render(rsx!(
div {
h1 { "Title" }
p { "Body" }
}
))
}
Closing this for the same reason as https://github.com/DioxusLabs/dioxus/issues/311. It is difficult to implement with templates
Specific Demand
I'm trying to add a
<!DOCTYPE html>
to the beginning of a SSR response.It seems the easiest way to make that happen would to be allow
rsx!
Fragment
to takedangerous_inner_html
.This doesn't seem to exist at this time: