Skip to content

Commit

Permalink
wasm-yew-minimal deps yew to 0..21.0 (#203)
Browse files Browse the repository at this point in the history
* wasm-yew-minimal  deps yew to 0..21.0

* Update examples/wasm-yew-minimal requirement yew from 0.19.0 to  0.21.0, hook from 0.1.56 to 0.3.2
  • Loading branch information
youngday authored May 26, 2024
1 parent 328ccb8 commit 5e03d0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/wasm-yew-minimal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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.2"
log = "0.4.6"
wasm-logger = "0.2"
14 changes: 5 additions & 9 deletions examples/wasm-yew-minimal/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ pub fn plot_component() -> Html {
Ok(())
}
});

use_effect_with_deps(
move |_| {
p.run();
|| ()
},
(),
);
// Only on first render
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 5e03d0f

Please sign in to comment.