remove Rc from the Component type alias

This commit is contained in:
Evan Almloff 2024-01-30 12:29:47 -06:00
parent 11555e4a51
commit aa03a6316a
2 changed files with 1 additions and 8 deletions

View file

@ -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::{

View file

@ -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 {