File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
packages/react-router/lib/dom/ssr Expand file tree Collapse file tree 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";
22
33import { decode } from "../../../vendor/turbo-stream-v2/turbo-stream" ;
44import type { Router as DataRouter } from "../../router/router" ;
5- import { isResponse } from "../../router/router" ;
5+ import { isDataWithResponseInit , isResponse } from "../../router/router" ;
66import type {
77 DataStrategyFunction ,
88 DataStrategyFunctionArgs ,
@@ -289,7 +289,11 @@ async function singleFetchActionStrategy(
289289 return result ;
290290 } ) ;
291291
292- if ( isResponse ( result . result ) || isRouteErrorResponse ( result . result ) ) {
292+ if (
293+ isResponse ( result . result ) ||
294+ isRouteErrorResponse ( result . result ) ||
295+ isDataWithResponseInit ( result . result )
296+ ) {
293297 return { [ actionMatch . route . id ] : result } ;
294298 }
295299
You can’t perform that action at this time.
0 commit comments