From 6922714e26976c84d2ea131b949bdbbb28ee47f7 Mon Sep 17 00:00:00 2001 From: yunaka354 Date: Mon, 11 Dec 2023 23:27:10 -0500 Subject: [PATCH] #173 update example for Yew --- examples/wasm-yew-minimal/Cargo.toml | 6 +++--- examples/wasm-yew-minimal/src/main.rs | 12 ++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/examples/wasm-yew-minimal/Cargo.toml b/examples/wasm-yew-minimal/Cargo.toml index ea8d220d..0ac01839 100644 --- a/examples/wasm-yew-minimal/Cargo.toml +++ b/examples/wasm-yew-minimal/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "wasm-yew-minimal" version = "0.1.0" -authors = ["Michael Freeborn "] +authors = ["Michael Freeborn ", "Yuichi Nakamura "] edition = "2021" [dependencies] plotly = { path = "../../plotly", features = ["wasm"] } -yew = "0.19.0" -yew-hooks = "0.1.56" +yew = "0.21.0" +yew-hooks = "0.3.0" log = "0.4.6" wasm-logger = "0.2" \ No newline at end of file diff --git a/examples/wasm-yew-minimal/src/main.rs b/examples/wasm-yew-minimal/src/main.rs index 8649c03c..456bc187 100644 --- a/examples/wasm-yew-minimal/src/main.rs +++ b/examples/wasm-yew-minimal/src/main.rs @@ -19,13 +19,9 @@ pub fn plot_component() -> Html { } }); - use_effect_with_deps( - move |_| { - p.run(); - || () - }, - (), - ); + use_effect_with((), move |_| { + p.run(); + }); html! {
@@ -34,5 +30,5 @@ pub fn plot_component() -> Html { fn main() { wasm_logger::init(wasm_logger::Config::default()); - yew::start_app::(); + yew::Renderer::::new().render(); }