dioxus/packages/ssr
2021-07-27 00:27:07 -04:00
..
.vscode Feat: dirty hack to enable send + sync on virtual dom 2021-05-28 00:28:09 -04:00
examples wip: some ideas 2021-07-18 03:54:42 -04:00
src Feat: solve some issues regarding listeners 2021-07-24 00:29:23 -04:00
Cargo.toml feat: omg what a dumb mistake 2021-07-27 00:27:07 -04:00
index.html feat: enable components in ssr 2021-07-11 15:17:55 -04:00
README.md feat: static node infrastructure and ssr changes 2021-07-11 14:49:52 -04:00

Dioxus SSR

Render a Dioxus VirtualDOM to a string.

// Our app:
const App: FC<()> = |cx| cx.render(rsx!(div {"hello world!"}));

// Build the virtualdom from our app
let mut vdom = VirtualDOM::new(App);

// This runs components, lifecycles, etc. without needing a physical dom. Some features (like noderef) won't work.
vdom.rebuild_in_place();

// Render the entire virtualdom from the root
let text = dioxus_ssr::render_root(&vdom);
assert_eq!(text, "<div>hello world!</div>")