docs: examples

This commit is contained in:
Jonathan Kelley committed 2021-07-02 01:30:52 -04:00
1 parent 818043e5e4
commit d9e6d0925b
33 files changed
+732 -152

No files matched your search

+8 -2
View File
@@ -120,7 +120,7 @@ static Example: FC<()> = |cx| {
{if true {
rsx!(in cx, h1 {"Top text"})
} else {
cx.render(rsx!( h1 {"Bottom text"}))
rsx!(in cx, h1 {"Bottom text"})
}}
// returning "None" is a bit noisy... but rare in practice
@@ -168,7 +168,13 @@ static Example: FC<()> = |cx| {
rsx!(Taller { ..props })
}}
// Can take children
// Spreading can also be overridden manually
Taller {
..TallerProps { a: "ballin!" }
a: "not ballin!"
}
// Can take children too!
Taller { a: "asd", div {"hello world!"} }
}
})