wip: go back to noisy lifetime solution
This commit is contained in:
1 parent
0545d27182
commit
8daf7a6ed8
31 files changed
+214
-170
No files matched your search
@@ -20,7 +20,7 @@ fn main() {
|
||||
dioxus::desktop::launch(App, |c| c);
|
||||
}
|
||||
|
||||
fn App(cx: Context, props: &()) -> Element {
|
||||
fn App(cx: Scope, props: &()) -> Element {
|
||||
let text: &mut Vec<String> = cx.use_hook(|_| vec![String::from("abc=def")], |f| f);
|
||||
|
||||
let first = text.get_mut(0).unwrap();
|
||||
@@ -39,7 +39,7 @@ struct C1Props<'a> {
|
||||
text: &'a mut String,
|
||||
}
|
||||
|
||||
fn Child1(cx: Context, props: &C1Props) -> Element {
|
||||
fn Child1(cx: Scope, props: &C1Props) -> Element {
|
||||
let (left, right) = props.text.split_once("=").unwrap();
|
||||
|
||||
cx.render(rsx! {
|
||||
@@ -55,7 +55,7 @@ struct C2Props<'a> {
|
||||
text: &'a str,
|
||||
}
|
||||
|
||||
fn Child2(cx: Context, props: &C2Props) -> Element {
|
||||
fn Child2(cx: Scope, props: &C2Props) -> Element {
|
||||
cx.render(rsx! {
|
||||
Child3 {
|
||||
text: props.text
|
||||
@@ -68,7 +68,7 @@ struct C3Props<'a> {
|
||||
text: &'a str,
|
||||
}
|
||||
|
||||
fn Child3(cx: Context, props: &C3Props) -> Element {
|
||||
fn Child3(cx: Scope, props: &C3Props) -> Element {
|
||||
cx.render(rsx! {
|
||||
div { "{props.text}"}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user