@@ -91,25 +91,32 @@ impl Reconcilable for VSuspense {
9191 }
9292 }
9393
94- fn reconcile (
94+ fn reconcile_node (
9595 self ,
9696 parent_scope : & AnyScope ,
9797 parent : & Element ,
9898 next_sibling : NodeRef ,
9999 bundle : & mut BNode ,
100100 ) -> NodeRef {
101- let suspense = match bundle {
101+ match bundle {
102102 // We only preserve the child state if they are the same suspense.
103103 BNode :: BSuspense ( m)
104104 if m. key == self . key
105105 && self . detached_parent . as_ref ( ) == Some ( & m. detached_parent ) =>
106106 {
107- m
108- }
109- _ => {
110- return self . replace ( parent_scope, parent, next_sibling, bundle) ;
107+ self . reconcile ( parent_scope, parent, next_sibling, m)
111108 }
112- } ;
109+ _ => self . replace ( parent_scope, parent, next_sibling, bundle) ,
110+ }
111+ }
112+
113+ fn reconcile (
114+ self ,
115+ parent_scope : & AnyScope ,
116+ parent : & Element ,
117+ next_sibling : NodeRef ,
118+ suspense : & mut Self :: Bundle ,
119+ ) -> NodeRef {
113120 let VSuspense {
114121 children,
115122 fallback,
@@ -127,24 +134,24 @@ impl Reconcilable for VSuspense {
127134 match ( suspended, & mut suspense. fallback_bundle ) {
128135 // Both suspended, reconcile children into detached_parent, fallback into the DOM
129136 ( true , Some ( fallback_bundle) ) => {
130- children. reconcile (
137+ children. reconcile_node (
131138 parent_scope,
132139 & detached_parent,
133140 NodeRef :: default ( ) ,
134141 children_bundle,
135142 ) ;
136143
137- fallback. reconcile ( parent_scope, parent, next_sibling, fallback_bundle)
144+ fallback. reconcile_node ( parent_scope, parent, next_sibling, fallback_bundle)
138145 }
139146 // Not suspended, just reconcile the children into the DOM
140147 ( false , None ) => {
141- children. reconcile ( parent_scope, parent, next_sibling, children_bundle)
148+ children. reconcile_node ( parent_scope, parent, next_sibling, children_bundle)
142149 }
143150 // Freshly suspended. Shift children into the detached parent, then add fallback to the DOM
144151 ( true , None ) => {
145152 children_bundle. shift ( & detached_parent, NodeRef :: default ( ) ) ;
146153
147- children. reconcile (
154+ children. reconcile_node (
148155 parent_scope,
149156 & detached_parent,
150157 NodeRef :: default ( ) ,
@@ -160,7 +167,7 @@ impl Reconcilable for VSuspense {
160167 suspense. fallback_bundle . take ( ) . unwrap ( ) . detach ( parent) ;
161168
162169 children_bundle. shift ( parent, next_sibling. clone ( ) ) ;
163- children. reconcile ( parent_scope, parent, next_sibling, children_bundle)
170+ children. reconcile_node ( parent_scope, parent, next_sibling, children_bundle)
164171 }
165172 }
166173 }
0 commit comments