فهرست منبع

fix the component macro when the function takes a single argument

Evan Almloff 1 سال پیش
والد
کامیت
8d783490a0
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      packages/core-macro/src/component_body/mod.rs

+ 1 - 1
packages/core-macro/src/component_body/mod.rs

@@ -194,7 +194,7 @@ impl Parse for ComponentBody {
             ));
         }
 
-        let has_extra_args = item_fn.sig.inputs.len() > 1;
+        let has_extra_args = !item_fn.sig.inputs.is_empty();
 
         Ok(Self {
             item_fn,