diff --git a/packages/yew/src/html/component/lifecycle.rs b/packages/yew/src/html/component/lifecycle.rs
index 517c123d341..d65d660c3b3 100644
--- a/packages/yew/src/html/component/lifecycle.rs
+++ b/packages/yew/src/html/component/lifecycle.rs
@@ -158,6 +158,9 @@ pub(crate) trait Stateful {
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
+
+ #[cfg(feature = "hydration")]
+ fn mode(&self) -> RenderMode;
}
impl Stateful for CompStateInner
@@ -180,6 +183,11 @@ where
self.context.link().clone().into()
}
+ #[cfg(feature = "hydration")]
+ fn mode(&self) -> RenderMode {
+ self.context.mode
+ }
+
fn flush_messages(&mut self) -> bool {
self.context
.link()
@@ -198,7 +206,7 @@ where
};
if self.context.props != props {
- self.context.props = Rc::clone(&props);
+ self.context.props = props;
self.component.changed(&self.context)
} else {
false
@@ -221,6 +229,8 @@ pub(crate) struct ComponentState {
#[cfg(feature = "csr")]
has_rendered: bool,
+ #[cfg(feature = "hydration")]
+ pending_props: Option>,
suspension: Option,
@@ -263,6 +273,8 @@ impl ComponentState {
#[cfg(feature = "csr")]
has_rendered: false,
+ #[cfg(feature = "hydration")]
+ pending_props: None,
comp_id,
}
@@ -303,9 +315,9 @@ impl Runnable for CreateRunner {
#[cfg(feature = "csr")]
pub(crate) struct PropsUpdateRunner {
- pub props: Rc,
+ pub props: Option>,
pub state: Shared