File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -205,10 +205,16 @@ export function enqueueRender(c) {
205
205
}
206
206
}
207
207
208
+ /**
209
+ * @param {import('./internal').Component } a
210
+ * @param {import('./internal').Component } b
211
+ */
212
+ const depthSort = ( a , b ) => a . _vnode . _depth - b . _vnode . _depth ;
213
+
208
214
/** Flush the render queue by rerendering all queued components */
209
215
function process ( ) {
210
216
let c ;
211
- rerenderQueue . sort ( ( a , b ) => a . _vnode . _depth - b . _vnode . _depth ) ;
217
+ rerenderQueue . sort ( depthSort ) ;
212
218
// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary
213
219
// process() calls from getting scheduled while `queue` is still being consumed.
214
220
while ( ( c = rerenderQueue . shift ( ) ) ) {
@@ -219,7 +225,7 @@ function process() {
219
225
// When i.e. rerendering a provider additional new items can be injected, we want to
220
226
// keep the order from top to bottom with those new items so we can handle them in a
221
227
// single pass
222
- rerenderQueue . sort ( ( a , b ) => a . _vnode . _depth - b . _vnode . _depth ) ;
228
+ rerenderQueue . sort ( depthSort ) ;
223
229
}
224
230
}
225
231
}
You can’t perform that action at this time.
0 commit comments