File tree 2 files changed +11
-2
lines changed
packages/react-router/lib/dom/ssr
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " react-router " : patch
3
+ ---
4
+
5
+ Preserve status code if a ` clientAction ` throws a ` data() ` result in framework mode
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import * as React from "react";
2
2
3
3
import { decode } from "../../../vendor/turbo-stream-v2/turbo-stream" ;
4
4
import type { Router as DataRouter } from "../../router/router" ;
5
- import { isResponse } from "../../router/router" ;
5
+ import { isDataWithResponseInit , isResponse } from "../../router/router" ;
6
6
import type {
7
7
DataStrategyFunction ,
8
8
DataStrategyFunctionArgs ,
@@ -289,7 +289,11 @@ async function singleFetchActionStrategy(
289
289
return result ;
290
290
} ) ;
291
291
292
- if ( isResponse ( result . result ) || isRouteErrorResponse ( result . result ) ) {
292
+ if (
293
+ isResponse ( result . result ) ||
294
+ isRouteErrorResponse ( result . result ) ||
295
+ isDataWithResponseInit ( result . result )
296
+ ) {
293
297
return { [ actionMatch . route . id ] : result } ;
294
298
}
295
299
You can’t perform that action at this time.
0 commit comments