add a noop evaluator to the ssr renderer

This commit is contained in:
Evan Almloff committed 2023-11-05 08:32:39 -06:00
1 parent c18f911429
commit b9554fd744
6 files changed
+51

No files matched your search

@@ -24,6 +24,7 @@ fn app(cx: Scope<AppProps>) -> Element {
let mut count = use_state(cx, || 0);
let text = use_state(cx, || "...".to_string());
let eval = use_eval(cx);
cx.render(rsx! {
div {
+2
View File
@@ -45,6 +45,8 @@ impl SsrRendererPool {
.expect("couldn't spawn runtime")
.block_on(async move {
let mut vdom = VirtualDom::new_with_props(component, props);
// Make sure the evaluator is initialized
dioxus_ssr::eval::init_eval(vdom.base_scope());
let mut to = WriteBuffer { buffer: Vec::new() };
// before polling the future, we need to set the context
let prev_context =