chore: rename ctx to cx
This commit is contained in:
1 parent
23c14078bb
commit
81382e7044
99 files changed
+789
-664
No files matched your search
@@ -120,14 +120,14 @@ impl ToTokens for Component {
|
||||
|
||||
let childs = &self.children;
|
||||
let children = quote! {
|
||||
ChildrenList::new(__ctx)
|
||||
ChildrenList::new(__cx)
|
||||
#( .add_child(#childs) )*
|
||||
.finish()
|
||||
};
|
||||
|
||||
tokens.append_all(quote! {
|
||||
dioxus::builder::virtual_child(
|
||||
__ctx,
|
||||
__cx,
|
||||
#name,
|
||||
#builder,
|
||||
#key_token,
|
||||
|
||||
@@ -68,7 +68,7 @@ impl ToTokens for Element {
|
||||
let name = &self.name.to_string();
|
||||
|
||||
tokens.append_all(quote! {
|
||||
dioxus::builder::ElementBuilder::new(__ctx, #name)
|
||||
dioxus::builder::ElementBuilder::new(__cx, #name)
|
||||
});
|
||||
|
||||
for attr in self.attrs.iter() {
|
||||
@@ -221,13 +221,13 @@ impl ToTokens for ElementAttr {
|
||||
}
|
||||
AttrType::Event(event) => {
|
||||
tokens.append_all(quote! {
|
||||
.add_listener(dioxus::events::on::#nameident(__ctx, #event))
|
||||
.add_listener(dioxus::events::on::#nameident(__cx, #event))
|
||||
});
|
||||
}
|
||||
AttrType::EventTokens(event) => {
|
||||
//
|
||||
tokens.append_all(quote! {
|
||||
.add_listener(dioxus::events::on::#nameident(__ctx, #event))
|
||||
.add_listener(dioxus::events::on::#nameident(__cx, #event))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,14 +50,14 @@ impl ToTokens for Fragment {
|
||||
fn to_tokens(&self, tokens: &mut TokenStream2) {
|
||||
let childs = &self.children;
|
||||
let children = quote! {
|
||||
ChildrenList::new(__ctx)
|
||||
ChildrenList::new(__cx)
|
||||
#( .add_child(#childs) )*
|
||||
.finish()
|
||||
};
|
||||
tokens.append_all(quote! {
|
||||
// #key_token,
|
||||
dioxus::builder::vfragment(
|
||||
__ctx,
|
||||
__cx,
|
||||
None,
|
||||
#children
|
||||
)
|
||||
|
||||
@@ -81,14 +81,14 @@ impl ToTokens for RsxRender {
|
||||
} else {
|
||||
let childs = &self.roots;
|
||||
let children = quote! {
|
||||
ChildrenList::new(__ctx)
|
||||
ChildrenList::new(__cx)
|
||||
#( .add_child(#childs) )*
|
||||
.finish()
|
||||
};
|
||||
quote! {
|
||||
// #key_token,
|
||||
dioxus::builder::vfragment(
|
||||
__ctx,
|
||||
__cx,
|
||||
None,
|
||||
#children
|
||||
)
|
||||
@@ -96,17 +96,17 @@ impl ToTokens for RsxRender {
|
||||
};
|
||||
|
||||
match &self.custom_context {
|
||||
// The `in ctx` pattern allows directly rendering
|
||||
// The `in cx` pattern allows directly rendering
|
||||
Some(ident) => out_tokens.append_all(quote! {
|
||||
#ident.render(dioxus::prelude::LazyNodes::new(move |__ctx|{
|
||||
let bump = &__ctx.bump();
|
||||
#ident.render(dioxus::prelude::LazyNodes::new(move |__cx|{
|
||||
let bump = &__cx.bump();
|
||||
#inner
|
||||
}))
|
||||
}),
|
||||
// Otherwise we just build the LazyNode wrapper
|
||||
None => out_tokens.append_all(quote! {
|
||||
dioxus::prelude::LazyNodes::new(move |__ctx|{
|
||||
let bump = &__ctx.bump();
|
||||
dioxus::prelude::LazyNodes::new(move |__cx|{
|
||||
let bump = &__cx.bump();
|
||||
#inner
|
||||
})
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user