Skip to content

Commit 6b9c96f

Browse files
committed
chore: refactor impl CsrStyle for Option<impl CsrStyle>
1 parent 93ad70b commit 6b9c96f

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

packages/frender-style/src/styles/option.rs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,9 @@ mod csr {
4040
}
4141
}
4242

43-
fn csr_style_render_init_with_old_state(
44-
this: Self,
45-
style: &mut impl crate::csr::CssStyleDeclaration,
46-
old_state: &mut Self::State,
47-
) {
48-
if let Some(this) = this {
49-
if let Some(old_state) = old_state {
50-
T::csr_style_render_init_with_old_state(this, style, old_state);
51-
} else {
52-
*old_state = Some(T::csr_style_render_init(this, style))
53-
}
54-
} else {
55-
// old_state had been unmounted, so just drop it
56-
*old_state = None;
57-
}
58-
}
43+
// old_state must have been set to None in its csr_style_state_unmount.
44+
// So we can just use the default implementation for
45+
// fn csr_style_render_init_with_old_state
5946

6047
fn csr_style_render_update(
6148
this: Self,

0 commit comments

Comments
 (0)