Skip to content

Commit e3748a0

Browse files
authored
[Fizz] Pass cancellation reason to abort (#27536)
This was implemented correctly for Flight but not Fizz. Hard to keep these many wrappers in sync.
1 parent a419575 commit e3748a0

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

packages/react-dom/src/server/ReactDOMFizzServerBrowser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function renderToReadableStream(
8080
},
8181
cancel: (reason): ?Promise<void> => {
8282
stopFlowing(request);
83-
abort(request);
83+
abort(request, reason);
8484
},
8585
},
8686
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
@@ -161,7 +161,7 @@ function resume(
161161
},
162162
cancel: (reason): ?Promise<void> => {
163163
stopFlowing(request);
164-
abort(request);
164+
abort(request, reason);
165165
},
166166
},
167167
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.

packages/react-dom/src/server/ReactDOMFizzServerBun.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function renderToReadableStream(
7070
},
7171
cancel: (reason): ?Promise<void> => {
7272
stopFlowing(request);
73-
abort(request);
73+
abort(request, reason);
7474
},
7575
},
7676
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.

packages/react-dom/src/server/ReactDOMFizzServerEdge.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function renderToReadableStream(
8080
},
8181
cancel: (reason): ?Promise<void> => {
8282
stopFlowing(request);
83-
abort(request);
83+
abort(request, reason);
8484
},
8585
},
8686
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
@@ -161,7 +161,7 @@ function resume(
161161
},
162162
cancel: (reason): ?Promise<void> => {
163163
stopFlowing(request);
164-
abort(request);
164+
abort(request, reason);
165165
},
166166
},
167167
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.

packages/react-dom/src/server/ReactDOMFizzStaticBrowser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function prerender(
6464
},
6565
cancel: (reason): ?Promise<void> => {
6666
stopFlowing(request);
67-
abort(request);
67+
abort(request, reason);
6868
},
6969
},
7070
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.

packages/react-dom/src/server/ReactDOMFizzStaticEdge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function prerender(
6464
},
6565
cancel: (reason): ?Promise<void> => {
6666
stopFlowing(request);
67-
abort(request);
67+
abort(request, reason);
6868
},
6969
},
7070
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.

0 commit comments

Comments
 (0)