mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-20 01:23:24 +00:00
41 lines
842 B
Rust
41 lines
842 B
Rust
use dioxus_core::prelude::*;
|
|
use dioxus_core::scope::FC;
|
|
use dioxus_core_macro::fc;
|
|
|
|
use std::marker::PhantomData;
|
|
// #[derive(PartialEq)]
|
|
// pub struct Example<'a> {
|
|
// b: &'a str,
|
|
// ___p: std::marker::PhantomData<&'a ()>,
|
|
// }
|
|
|
|
// impl<'a> FC for Example<'a> {
|
|
// fn render(ctx: Context<'_>, props: &Example<'a>) -> DomTree {
|
|
// let Example { b, .. } = props;
|
|
// {
|
|
// ctx.render(rsx! {
|
|
// div { "abcd {b}" }
|
|
// })
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// always try to fill in with Default
|
|
|
|
#[fc]
|
|
fn Example(ctx: Context, a: &str, b: &str, c: &str) -> DomTree {
|
|
ctx.render(rsx! {
|
|
div {
|
|
SomeComponent {
|
|
a: "123"
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
#[fc]
|
|
fn SomeComponent(ctx: Context, a: &str, b: &str) -> DomTree {
|
|
todo!()
|
|
}
|
|
|
|
fn main() {}
|