@@ -34,7 +34,7 @@ pub static Example0: FC<MyProps> = |cx| {
3434// which will do essentially the same thing as `cx.render`.
3535//
3636// In short:
37- // `rsx!(in cx, ...)` is shorthand for `cx.render(rsx!(...))`
37+ // `rsx!(cx, ...)` is shorthand for `cx.render(rsx!(...))`
3838#[ derive( PartialEq , Props ) ]
3939pub struct MyProps1 {
4040 should_show : bool ,
@@ -45,21 +45,21 @@ pub static Example1: FC<MyProps1> = |cx| {
4545 // With matching
4646 { match cx. should_show {
4747 true => cx. render( rsx!( div { "it is true!" } ) ) ,
48- false => rsx!( in cx, div { "it is false!" } ) ,
48+ false => rsx!( cx, div { "it is false!" } ) ,
4949 } }
5050
5151 // or with just regular conditions
5252 { if cx. should_show {
53- rsx!( in cx, div { "it is true!" } )
53+ rsx!( cx, div { "it is true!" } )
5454 } else {
55- rsx!( in cx, div { "it is false!" } )
55+ rsx!( cx, div { "it is false!" } )
5656 } }
5757
5858 // or with optional chaining
5959 {
6060 cx. should_show
61- . then( || rsx!( in cx, div { "it is false!" } ) )
62- . unwrap_or_else( || rsx!( in cx, div { "it is false!" } ) )
61+ . then( || rsx!( cx, div { "it is false!" } ) )
62+ . unwrap_or_else( || rsx!( cx, div { "it is false!" } ) )
6363 }
6464 }
6565 } )
@@ -81,9 +81,9 @@ pub static Example2: FC<MyProps2> = |cx| {
8181 cx. render ( rsx ! {
8282 div {
8383 { match cx. color {
84- Color :: Green => rsx!( in cx, div { "it is Green!" } ) ,
85- Color :: Yellow => rsx!( in cx, div { "it is Yellow!" } ) ,
86- Color :: Red => rsx!( in cx, div { "it is Red!" } ) ,
84+ Color :: Green => rsx!( cx, div { "it is Green!" } ) ,
85+ Color :: Yellow => rsx!( cx, div { "it is Yellow!" } ) ,
86+ Color :: Red => rsx!( cx, div { "it is Red!" } ) ,
8787 } }
8888 }
8989 } )
0 commit comments