Commit 46f6ded 1 parent e9c4b49 commit 46f6ded Copy full SHA for 46f6ded
File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 75
75
E : IntoView ,
76
76
{
77
77
let prev_children = std:: rc:: Rc :: new ( RefCell :: new ( None :: < Vec < View > > ) ) ;
78
+
79
+ #[ cfg( not( feature = "hydrate" ) ) ]
80
+ let first_run = std:: cell:: Cell :: new ( true ) ;
81
+
82
+ // in hydration mode, "first" run is on the server
83
+ #[ cfg( feature = "hydrate" ) ]
84
+ let first_run = std:: cell:: Cell :: new ( false ) ;
85
+
78
86
crate :: Suspense (
79
87
cx,
80
88
crate :: SuspenseProps :: builder ( )
@@ -93,7 +101,12 @@ where
93
101
} )
94
102
. children ( Box :: new ( move |cx| {
95
103
let frag = children ( cx) ;
96
- * prev_children. borrow_mut ( ) = Some ( frag. nodes . clone ( ) ) ;
104
+
105
+ if !first_run. get ( ) {
106
+ * prev_children. borrow_mut ( ) = Some ( frag. nodes . clone ( ) ) ;
107
+ }
108
+ first_run. set ( false ) ;
109
+
97
110
if let Some ( set_pending) = & set_pending {
98
111
set_pending. set ( false ) ;
99
112
}
You can’t perform that action at this time.
0 commit comments