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) {
205205 }
206206}
207207
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+
208214/** Flush the render queue by rerendering all queued components */
209215function process ( ) {
210216 let c ;
211- rerenderQueue . sort ( ( a , b ) => a . _vnode . _depth - b . _vnode . _depth ) ;
217+ rerenderQueue . sort ( depthSort ) ;
212218 // Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary
213219 // process() calls from getting scheduled while `queue` is still being consumed.
214220 while ( ( c = rerenderQueue . shift ( ) ) ) {
@@ -219,7 +225,7 @@ function process() {
219225 // When i.e. rerendering a provider additional new items can be injected, we want to
220226 // keep the order from top to bottom with those new items so we can handle them in a
221227 // single pass
222- rerenderQueue . sort ( ( a , b ) => a . _vnode . _depth - b . _vnode . _depth ) ;
228+ rerenderQueue . sort ( depthSort ) ;
223229 }
224230 }
225231 }
You can’t perform that action at this time.
0 commit comments