|
|
@@ -50,6 +50,11 @@ export const isSuspense = (type: any): boolean => type.__isSuspense
|
|
|
// incrementing unique id for every pending branch
|
|
|
let suspenseId = 0
|
|
|
|
|
|
+/**
|
|
|
+ * For testing only
|
|
|
+ */
|
|
|
+export const resetSuspenseId = () => (suspenseId = 0)
|
|
|
+
|
|
|
// Suspense exposes a component-like API, and is treated like a component
|
|
|
// in the compiler, but internally it's a special built-in type that hooks
|
|
|
// directly into the renderer.
|
|
|
@@ -476,7 +481,7 @@ function createSuspenseBoundary(
|
|
|
hiddenContainer,
|
|
|
anchor,
|
|
|
deps: 0,
|
|
|
- pendingId: 0,
|
|
|
+ pendingId: suspenseId++,
|
|
|
timeout: typeof timeout === 'number' ? timeout : -1,
|
|
|
activeBranch: null,
|
|
|
pendingBranch: null,
|