File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/react-dom/src/client Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -392,6 +392,7 @@ export const scheduleTimeout: any =
392392export const cancelTimeout : any =
393393 typeof clearTimeout === 'function' ? clearTimeout : ( undefined : any ) ;
394394export const noTimeout = - 1 ;
395+ const localPromise = Promise ;
395396
396397// -------------------
397398// Microtasks
@@ -400,9 +401,10 @@ export const supportsMicrotasks = true;
400401export const scheduleMicrotask : any =
401402 typeof queueMicrotask === 'function'
402403 ? queueMicrotask
403- : typeof Promise !== 'undefined'
404+ : typeof localPromise !== 'undefined'
404405 ? callback =>
405- Promise . resolve ( null )
406+ localPromise
407+ . resolve ( null )
406408 . then ( callback )
407409 . catch ( handleErrorInNextTick )
408410 : scheduleTimeout ; // TODO: Determine the best fallback here.
You can’t perform that action at this time.
0 commit comments