Skip to content

Commit

Permalink
plotly#173 update example for Yew
Browse files Browse the repository at this point in the history
  • Loading branch information
yunaka354 committed Dec 12, 2023
1 parent 3a9f7ef commit 6922714
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions examples/wasm-yew-minimal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "wasm-yew-minimal"
version = "0.1.0"
authors = ["Michael Freeborn <michaelfreeborn1@gmail.com>"]
authors = ["Michael Freeborn <michaelfreeborn1@gmail.com>", "Yuichi Nakamura <yuichi.nakamura86@gmail.com>"]
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"
12 changes: 4 additions & 8 deletions examples/wasm-yew-minimal/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ pub fn plot_component() -> Html {
}
});

use_effect_with_deps(
move |_| {
p.run();
|| ()
},
(),
);
use_effect_with((), move |_| {
p.run();
});

html! {
<div id="plot-div"></div>
Expand All @@ -34,5 +30,5 @@ pub fn plot_component() -> Html {

fn main() {
wasm_logger::init(wasm_logger::Config::default());
yew::start_app::<App>();
yew::Renderer::<App>::new().render();
}

0 comments on commit 6922714

Please sign in to comment.