wip: go back to noisy lifetime solution

This commit is contained in:
Jonathan Kelley committed 2021-12-14 02:27:59 -05:00
1 parent 0545d27182
commit 8daf7a6ed8
31 files changed
+214 -170

No files matched your search

+3 -3
View File
@@ -10,7 +10,7 @@ fn test_borrowed_state() {
let _ = VirtualDom::new(Parent);
}
fn Parent(cx: Context, _props: &()) -> Element {
fn Parent(cx: Scope, _props: &()) -> Element {
let value = cx.use_hook(|_| String::new(), |f| &*f);
cx.render(rsx! {
@@ -28,7 +28,7 @@ struct ChildProps<'a> {
name: &'a str,
}
fn Child(cx: Context, props: &ChildProps) -> Element {
fn Child(cx: Scope, props: &ChildProps) -> Element {
cx.render(rsx! {
div {
h1 { "it's nested" }
@@ -42,7 +42,7 @@ struct Grandchild<'a> {
name: &'a str,
}
fn Child2(cx: Context, props: &Grandchild) -> Element {
fn Child2(cx: Scope, props: &Grandchild) -> Element {
cx.render(rsx! {
div { "Hello {props.name}!" }
})
+1 -1
View File
@@ -220,7 +220,7 @@ fn create_components() {
children: Element,
}
fn Child(cx: Context, props: &ChildProps) -> Element {
fn Child(cx: Scope, props: &ChildProps) -> Element {
cx.render(rsx! {
h1 {}
div { {&props.children} }