[Fizz] Allow passing a reason to abortStream (#26992)

## Summary

Currently `ReactFizzServer.abort` allows you to pass in the a `reason`
error, which then gets passed to the `onError` handler for each task
that ends up getting aborted. This adds in the ability to pass down that
same `reason` error to `ReactDOMServerFB.abortStream` as well.

## How did you test this change?

Added a test case to ReactDOMServerFB-test.internal.js

DiffTrain build for [1f4936660d](https://github.com/facebook/react/commit/1f4936660dcaba2e5722013f0ad12d7369543a9f)
This commit is contained in:
mofeiZ
2023-09-20 20:46:08 +00:00
parent fe4d7ee0fb
commit ca0b9f4020
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -1 +1 @@
b775564d35d6fe9f9acead0f380bbc86bb6bdd2c
1f4936660dcaba2e5722013f0ad12d7369543a9f
@@ -12848,8 +12848,8 @@ function renderToStream(children, options) {
};
}
function abortStream(stream) {
abort(stream.request);
function abortStream(stream, reason) {
abort(stream.request, reason);
}
function renderNextChunk(stream) {
@@ -4633,8 +4633,8 @@ function abort(request, reason) {
logRecoverableError(request, error$34), fatalError(request, error$34);
}
}
exports.abortStream = function (stream) {
abort(stream.request);
exports.abortStream = function (stream, reason) {
abort(stream.request, reason);
};
exports.debug = function (stream) {
stream = stream.request;
@@ -24360,7 +24360,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-modern-5efbcf55";
var ReactVersion = "18.3.0-www-modern-6126abbd";
// Might add PROFILE later.