mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Clean up (#15755)
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.
This commit is contained in:
+1
-6
@@ -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};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user