Browse Source

remove Rc from the Component type alias

Evan Almloff 1 year ago
parent
commit
aa03a6316a
2 changed files with 1 additions and 8 deletions
  1. 1 1
      packages/core/src/lib.rs
  2. 0 7
      packages/core/src/properties.rs

+ 1 - 1
packages/core/src/lib.rs

@@ -70,7 +70,7 @@ pub(crate) mod innerlude {
     ///     Example {}
     /// )
     /// ```
-    pub type Component<P = ()> = std::rc::Rc<dyn Fn(P) -> Element>;
+    pub type Component<P = ()> = fn(P) -> Element;
 }
 
 pub use crate::innerlude::{

+ 0 - 7
packages/core/src/properties.rs

@@ -106,13 +106,6 @@ pub trait ComponentFunction<Props, Marker = ()>: Clone + 'static {
     fn rebuild(&self, props: Props) -> Element;
 }
 
-/// Accept pre-formed component render functions as components
-impl<P: 'static> ComponentFunction<P> for Component<P> {
-    fn rebuild(&self, props: P) -> Element {
-        (self)(props)
-    }
-}
-
 /// Accept any callbacks that take props
 impl<F: Fn(P) -> Element + Clone + 'static, P> ComponentFunction<P> for F {
     fn rebuild(&self, props: P) -> Element {