docs: big updates to the reference

This commit is contained in:
Jonathan Kelley committed 2021-07-16 16:11:25 -04:00
1 parent caf772cf24
commit 583fdfa561
57 files changed
+726 -247

No files matched your search

+18 -3
View File
@@ -1,10 +1,25 @@
use dioxus::prelude::*;
fn main() {}
use dioxus::ssr;
pub static Example: FC<()> = |cx| {
let as_string = use_state(cx, || {
// Currently, SSR is only supported for whole VirtualDOMs
// This is an easy/low hanging fruit to improve upon
let mut dom = VirtualDom::new(SomeApp);
dom.rebuild_in_place().unwrap();
ssr::render_root(&dom)
});
static Example: FC<()> = |cx| {
cx.render(rsx! {
div {
div { "{as_string}" }
})
};
static SomeApp: FC<()> = |cx| {
cx.render(rsx! {
div { style: {background_color: "blue"}
h1 {"Some amazing app or component"}
p {"Things are great"}
}
})
};