File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,10 +141,16 @@ export function enqueueRender(internal) {
141141 }
142142}
143143
144+ /**
145+ * @param {import('./internal').Internal } a
146+ * @param {import('./internal').Internal } b
147+ */
148+ const depthSort = ( a , b ) => a . _depth - b . _depth ;
149+
144150/** Flush the render queue by rerendering all queued components */
145151function processRenderQueue ( ) {
146152 let c ;
147- renderQueue . sort ( ( a , b ) => a . _depth - b . _depth ) ;
153+ renderQueue . sort ( depthSort ) ;
148154 // Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary
149155 // process() calls from getting scheduled while `queue` is still being consumed.
150156 while ( ( c = renderQueue . shift ( ) ) ) {
@@ -155,7 +161,7 @@ function processRenderQueue() {
155161 // When i.e. rerendering a provider additional new items can be injected, we want to
156162 // keep the order from top to bottom with those new items so we can handle them in a
157163 // single pass
158- renderQueue . sort ( ( a , b ) => a . _depth - b . _depth ) ;
164+ renderQueue . sort ( depthSort ) ;
159165 }
160166 }
161167 }
You can’t perform that action at this time.
0 commit comments