File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed
examples/wasm-yew-minimal Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ edition = "2021"
6
6
7
7
[dependencies ]
8
8
plotly = { path = " ../../plotly" , features = [" wasm" ] }
9
- yew = " 0.19 .0"
10
- yew-hooks = " 0.1.56 "
9
+ yew = " 0.21 .0"
10
+ yew-hooks = " 0.3.2 "
11
11
log = " 0.4.6"
12
12
wasm-logger = " 0.2"
Original file line number Diff line number Diff line change @@ -18,14 +18,10 @@ pub fn plot_component() -> Html {
18
18
Ok ( ( ) )
19
19
}
20
20
} ) ;
21
-
22
- use_effect_with_deps (
23
- move |_| {
24
- p. run ( ) ;
25
- || ( )
26
- } ,
27
- ( ) ,
28
- ) ;
21
+ // Only on first render
22
+ use_effect_with ( ( ) , move |_| {
23
+ p. run ( ) ;
24
+ } ) ;
29
25
30
26
html ! {
31
27
<div id="plot-div" ></div>
@@ -34,5 +30,5 @@ pub fn plot_component() -> Html {
34
30
35
31
fn main ( ) {
36
32
wasm_logger:: init ( wasm_logger:: Config :: default ( ) ) ;
37
- yew:: start_app :: < App > ( ) ;
33
+ yew:: Renderer :: < App > :: new ( ) . render ( ) ;
38
34
}
You can’t perform that action at this time.
0 commit comments