wip: move examples around
This commit is contained in:
1 parent
d298b626d3
commit
1e6e5e611b
86 files changed
+160
-216
No files matched your search
@@ -162,13 +162,13 @@ pub static Example: FC<()> = |(cx, props)| {
|
||||
|
||||
// Can pass in props directly as an expression
|
||||
{{
|
||||
let props = TallerProps {a: "hello"};
|
||||
let props = TallerProps {a: "hello", children: Default::default()};
|
||||
rsx!(Taller { ..props })
|
||||
}}
|
||||
|
||||
// Spreading can also be overridden manually
|
||||
Taller {
|
||||
..TallerProps { a: "ballin!" }
|
||||
..TallerProps { a: "ballin!", children: Default::default() }
|
||||
a: "not ballin!"
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ pub static Example: FC<()> = |(cx, props)| {
|
||||
|
||||
mod baller {
|
||||
use super::*;
|
||||
#[derive(PartialEq, Props)]
|
||||
#[derive(Props, PartialEq)]
|
||||
pub struct BallerProps {}
|
||||
|
||||
/// This component totally balls
|
||||
@@ -189,13 +189,16 @@ mod baller {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Props)]
|
||||
pub struct TallerProps {
|
||||
#[derive(Props)]
|
||||
pub struct TallerProps<'a> {
|
||||
a: &'static str,
|
||||
|
||||
#[builder(default)]
|
||||
children: ScopeChildren<'a>,
|
||||
}
|
||||
|
||||
/// This component is taller than most :)
|
||||
pub fn Taller(_: Scope<TallerProps>) -> Element {
|
||||
pub fn Taller<'a>(_: Scope<'a, TallerProps<'a>>) -> Element {
|
||||
let b = true;
|
||||
todo!()
|
||||
}
|
||||
Reference in new issue
Block a user