remove cx.render

This commit is contained in:
Jonathan Kelley committed 2024-01-13 21:12:21 -08:00
1 parent fae0b08e61
commit 1dde044697
159 files changed
+600 -658

No files matched your search

@@ -27,6 +27,11 @@ fn get_out_comp_fn(orig_comp_fn: &ItemFn) -> ItemFn {
..orig_comp_fn.clone()
};
let props_ident = match orig_comp_fn.sig.inputs.is_empty() {
true => quote! {},
false => quote! { __props },
};
ItemFn {
block: parse_quote! {
{
@@ -34,7 +39,7 @@ fn get_out_comp_fn(orig_comp_fn: &ItemFn) -> ItemFn {
#[allow(clippy::inline_always)]
#[inline(always)]
#inner_comp_fn
#inner_comp_ident(__props)
#inner_comp_ident(#props_ident)
}
},
..orig_comp_fn.clone()
+2 -2
View File
@@ -66,7 +66,7 @@ pub fn render(s: TokenStream) -> TokenStream {
/// ```rust,ignore
/// #[inline_props]
/// fn app(bob: String) -> Element {
/// cx.render(rsx!("hello, {bob}"))
/// rsx!("hello, {bob}"))
/// }
///
/// // is equivalent to
@@ -77,7 +77,7 @@ pub fn render(s: TokenStream) -> TokenStream {
/// }
///
/// fn app(cx: Scope<AppProps>) -> Element {
/// cx.render(rsx!("hello, {bob}"))
/// rsx!("hello, {bob}"))
/// }
/// ```
#[proc_macro_attribute]