mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 12:43:08 +00:00
remove Rc from the Component type alias
This commit is contained in:
parent
11555e4a51
commit
aa03a6316a
2 changed files with 1 additions and 8 deletions
|
@ -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::{
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue