Skip to content

Commit

Permalink
Clean up (facebook#15755)
Browse files Browse the repository at this point in the history
expirationTime has already been checked if it's sync.

timeout can now be longer than 5 seconds when a suspense config is used.
We might want to adjust the heuristics but it's not internally consistent
without this.
  • Loading branch information
sebmarkbage authored May 28, 2019
1 parent d915a4c commit b74fa98
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,13 +493,8 @@ function scheduleCallbackForRoot(
);
} else {
let options = null;
if (expirationTime !== Sync && expirationTime !== Never) {
if (expirationTime !== Never) {
let timeout = expirationTimeToMs(expirationTime) - now();
if (timeout > 5000) {
// Sanity check. Should never take longer than 5 seconds.
// TODO: Add internal warning?
timeout = 5000;
}
options = {timeout};
}

Expand Down

0 comments on commit b74fa98

Please sign in to comment.