chore: rename all &cx to cx, make clipppy happy

This commit is contained in:
Jonathan Kelley committed 2022-12-07 13:11:40 -08:00
1 parent e8133e9449
commit 4eefc3f854
85 files changed
+256 -271

No files matched your search

+5 -13
View File
@@ -2,16 +2,13 @@
//!
//! This example shows how we can render the Dioxus Virtualdom using SSR.
use std::fmt::Write;
use dioxus::prelude::*;
use dioxus_ssr::config::Config;
fn main() {
// We can render VirtualDoms
let mut vdom = VirtualDom::new(app);
let _ = vdom.rebuild();
println!("{}", dioxus_ssr::render_vdom(&vdom));
println!("{}", dioxus_ssr::render(&vdom));
// Or we can render rsx! calls themselves
println!(
@@ -24,17 +21,12 @@ fn main() {
);
// We can configure the SSR rendering to add ids for rehydration
println!(
"{}",
dioxus_ssr::render_vdom_cfg(&vdom, Config::default().pre_render(true))
);
println!("{}", dioxus_ssr::pre_render(&vdom));
// We can even render as a writer
// We can render to a buf directly too
let mut file = String::new();
let _ = file.write_fmt(format_args!(
"{}",
dioxus_ssr::SsrRender::default().render_vdom(&vdom)
));
let mut renderer = dioxus_ssr::Renderer::default();
renderer.render_to(&mut file, &vdom).unwrap();
println!("{}", file);
}