wip: more examples

This commit is contained in:
Jonathan Kelley committed 2021-07-11 19:31:07 -04:00
1 parent 304259d818
commit 56e7eb83a9
21 files changed
+162 -236

No files matched your search

-28
View File
@@ -444,31 +444,3 @@ pub fn intern_cache() {
wasm_bindgen::intern(s);
}
}
#[cfg(test)]
mod tests {
use std::env;
use super::*;
use dioxus::prelude::bumpalo;
use dioxus::prelude::format_args_f;
use dioxus_core as dioxus;
use dioxus_core::prelude::html;
fn simple_patch() {
env::set_var("RUST_LOG", "trace");
pretty_env_logger::init();
log::info!("Hello!");
wasm_bindgen_futures::spawn_local(WebsysRenderer::start(|cx| {
todo!()
// cx.render(html! {
// <div>
// "Hello world"
// <button onclick={move |_| log::info!("button1 clicked!")}> "click me" </button>
// <button onclick={move |_| log::info!("button2 clicked!")}> "click me" </button>
// </div>
// })
}))
}
}
+2 -2
View File
@@ -2,7 +2,7 @@ use std::{collections::HashMap, rc::Rc, sync::Arc};
use dioxus_core::{
events::{EventTrigger, VirtualEvent},
prelude::{RealDomNode, ScopeIdx},
RealDomNode, ScopeIdx,
};
use fxhash::FxHashMap;
use slotmap::{DefaultKey, Key, KeyData};
@@ -192,7 +192,7 @@ impl<'a> dioxus_core::diff::RealDom<'a> for WebsysDom {
fn new_event_listener(
&mut self,
event: &'static str,
scope: dioxus_core::prelude::ScopeIdx,
scope: ScopeIdx,
_element_id: usize,
real_id: RealDomNode,
) {