@@ -110,7 +110,7 @@ const files = {
110
110
` ,
111
111
112
112
"app/routes/data-with-response.tsx" : js `
113
- import { useActionData, useLoaderData, unstable_data as data } from "react-router";
113
+ import { useActionData, useLoaderData, data } from "react-router";
114
114
115
115
export function headers ({ actionHeaders, loaderHeaders, errorHeaders }) {
116
116
if ([...actionHeaders].length > 0) {
@@ -253,7 +253,7 @@ test.describe("single-fetch", () => {
253
253
} ) ;
254
254
} ) ;
255
255
256
- test ( "loads proper data (via unstable_data ) on single fetch loader requests" , async ( ) => {
256
+ test ( "loads proper data (via data() ) on single fetch loader requests" , async ( ) => {
257
257
let fixture = await createFixture ( {
258
258
files,
259
259
} ) ;
@@ -280,7 +280,7 @@ test.describe("single-fetch", () => {
280
280
} ) ;
281
281
} ) ;
282
282
283
- test ( "loads proper data (via unstable_data ) on single fetch action requests" , async ( ) => {
283
+ test ( "loads proper data (via data() ) on single fetch action requests" , async ( ) => {
284
284
let fixture = await createFixture ( {
285
285
files,
286
286
} ) ;
@@ -505,28 +505,28 @@ test.describe("single-fetch", () => {
505
505
expect ( urls ) . toEqual ( [ ] ) ;
506
506
} ) ;
507
507
508
- test ( "does not revalidate on 4xx/5xx action responses (via unstable_data )" , async ( {
508
+ test ( "does not revalidate on 4xx/5xx action responses (via data() )" , async ( {
509
509
page,
510
510
} ) => {
511
511
let fixture = await createFixture ( {
512
512
files : {
513
513
...files ,
514
514
"app/routes/action.tsx" : js `
515
- import { Form, Link, useActionData, useLoaderData, useNavigation, unstable_data } from 'react-router';
515
+ import { Form, Link, useActionData, useLoaderData, useNavigation, data } from 'react-router';
516
516
517
517
export async function action({ request }) {
518
518
let fd = await request.formData();
519
519
if (fd.get('throw') === "5xx") {
520
- throw unstable_data ("Thrown 500", { status: 500 });
520
+ throw data ("Thrown 500", { status: 500 });
521
521
}
522
522
if (fd.get('throw') === "4xx") {
523
- throw unstable_data ("Thrown 400", { status: 400 });
523
+ throw data ("Thrown 400", { status: 400 });
524
524
}
525
525
if (fd.get('return') === "5xx") {
526
- return unstable_data ("Returned 500", { status: 500 });
526
+ return data ("Returned 500", { status: 500 });
527
527
}
528
528
if (fd.get('return') === "4xx") {
529
- return unstable_data ("Returned 400", { status: 400 });
529
+ return data ("Returned 400", { status: 400 });
530
530
}
531
531
return null;
532
532
}
0 commit comments