MCPcopy
hub / github.com/facebook/react / untrackBoundary

Function untrackBoundary

packages/react-server/src/ReactFizzServer.js:4010–4034  ·  view source on GitHub ↗
(request: Request, boundary: SuspenseBoundary)

Source from the content-addressed store, hash-verified

4008// In case a boundary errors, we need to stop tracking it because we won't
4009// resume it.
4010function untrackBoundary(request: Request, boundary: SuspenseBoundary) {
4011 const trackedPostpones = request.trackedPostpones;
4012 if (trackedPostpones === null) {
4013 return;
4014 }
4015 const boundaryKeyPath = boundary.trackedContentKeyPath;
4016 if (boundaryKeyPath === null) {
4017 return;
4018 }
4019 const boundaryNode: void | ReplayNode =
4020 trackedPostpones.workingMap.get(boundaryKeyPath);
4021 if (boundaryNode === undefined) {
4022 return;
4023 }
4024
4025 // Downgrade to plain ReplayNode since we won't replay through it.
4026 // $FlowFixMe[cannot-write]: We intentionally downgrade this to the other tuple.
4027 boundaryNode.length = 4;
4028 // Remove any resumable slots.
4029 boundaryNode[2] = [];
4030 boundaryNode[3] = null;
4031
4032 // TODO: We should really just remove the boundary from all parent paths too so
4033 // we don't replay the path to it.
4034}
4035
4036function injectPostponedHole(
4037 request: Request,

Callers 3

renderSuspenseBoundaryFunction · 0.85
erroredTaskFunction · 0.85
abortTaskFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected