[Fizz] Reset Instructions on ResumableState (#33046)
When we end up creating an incomplete state in the shell we end up not flushing anything. As a hack, in this case we need to reset the ResumableState because some of the ResumableState is still relevant (e.g. any preloads that went into headers) but some of the ResumableState needs to be reset since they assume that what we produced actually flushed. We didn't reset the instructions state but we haven't actually flushed any of the instructions so it needs to reset.
Sebastian Markbåge committed
Apr 28, 2025 at 15:50 UTC
5dc00d6b2b7798266c1e3b6132f1d076fa9f55d7
1 file changed
+1
packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js
+1
@@ -695,6 +695,7 @@ export function resetResumableState(
695
resumableState.scriptResources = {};
696
resumableState.moduleUnknownResources = {};
697
resumableState.moduleScriptResources = {};
698
+ resumableState.instructions = NothingSent; // Nothing was flushed so no instructions could've flushed.
699
}
700
701
export function completeResumableState(resumableState: ResumableState): void {