File tree Expand file tree Collapse file tree 3 files changed +10
-31
lines changed
Expand file tree Collapse file tree 3 files changed +10
-31
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ edition = "2021"
66# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77
88[dependencies ]
9- yew = " 0.18 "
9+ yew = { version = " 0.20 " , features = [ " csr " ] }
Original file line number Diff line number Diff line change 11<!DOCTYPE html>
2- < html >
3- < head >
4- < meta charset ="utf-8 " />
5- < title > Hello, World!</ title >
6- </ head >
7- </ html >
2+ < html lang ="en ">
3+ < head > </ head >
4+ < body > </ body >
5+ </ html >
Original file line number Diff line number Diff line change 11use yew:: prelude:: * ;
22
3- struct Index ;
4- impl Component for Index {
5- type Message = ( ) ;
6- type Properties = ( ) ;
7-
8- fn create ( _: Self :: Properties , _: ComponentLink < Self > ) -> Self {
9- Self
10- }
11-
12- fn update ( & mut self , _: Self :: Message ) -> ShouldRender {
13- false
14- }
15-
16- fn change ( & mut self , _: Self :: Properties ) -> ShouldRender {
17- false
18- }
19-
20- fn view ( & self ) -> Html {
21- html ! {
22- <div>
23- { "Hello, World!" }
24- </div>
25- }
3+ #[ function_component( App ) ]
4+ fn app ( ) -> Html {
5+ html ! {
6+ <h1>{ "Hello World" } </h1>
267 }
278}
289
2910fn main ( ) {
30- yew:: start_app :: < Index > ( ) ;
11+ yew:: Renderer :: < App > :: new ( ) . render ( ) ;
3112}
You can’t perform that action at this time.
0 commit comments