Create "responses" that contain headers/status without forcing serialization into an actual Response
headers
status
Response
The data to be included in the response.
Optional
The status code or a ResponseInit object to be included in the response.
ResponseInit
A DataWithResponseInit instance containing the data and response init.
import { data } from "react-router";export async function action({ request }: Route.ActionArgs) { let formData = await request.formData(); let item = await createItem(formData); return data(item, { headers: { "X-Custom-Header": "value" } status: 201, });}@public Copy
import { data } from "react-router";export async function action({ request }: Route.ActionArgs) { let formData = await request.formData(); let item = await createItem(formData); return data(item, { headers: { "X-Custom-Header": "value" } status: 201, });}@public
framework
data
Create "responses" that contain
headers/statuswithout forcing serialization into an actualResponse