From c781156163f014d15eeb464296a17aba4406d2ec Mon Sep 17 00:00:00 2001 From: Faelivrinx Date: Mon, 6 Apr 2020 17:17:45 +0200 Subject: [PATCH] Fix performance issue in react-devtools when highlight enabled (#18498) * Fix performance issue in react-devtools when highlight enabled * getting minimum expiration time (fix) --- .../src/backend/views/TraceUpdates/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-devtools-shared/src/backend/views/TraceUpdates/index.js b/packages/react-devtools-shared/src/backend/views/TraceUpdates/index.js index e94d4fd5c13d0..0637d7b818f10 100644 --- a/packages/react-devtools-shared/src/backend/views/TraceUpdates/index.js +++ b/packages/react-devtools-shared/src/backend/views/TraceUpdates/index.js @@ -127,7 +127,9 @@ function prepareToDraw(): void { draw(nodeToData); - redrawTimeoutID = setTimeout(prepareToDraw, earliestExpiration - now); + if (earliestExpiration !== Number.MAX_VALUE) { + redrawTimeoutID = setTimeout(prepareToDraw, earliestExpiration - now); + } } function measureNode(node: Object): Rect | null {