From 0ada21eac71d01ea2a3a97d6574933cbc863af68 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Thu, 21 Dec 2023 13:18:19 -0500 Subject: [PATCH] Re-export response helpers through react package --- .changeset/twelve-cars-work.md | 5 +++++ packages/remix-react/index.tsx | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .changeset/twelve-cars-work.md diff --git a/.changeset/twelve-cars-work.md b/.changeset/twelve-cars-work.md new file mode 100644 index 00000000000..723c68ee7c2 --- /dev/null +++ b/.changeset/twelve-cars-work.md @@ -0,0 +1,5 @@ +--- +"@remix-run/react": patch +--- + +Export `Response` helpers (`defer`/`json`/`redirect`/`redirectDocument`) through `@remix-run/react` for use in `clientLoader`/`clientAction` diff --git a/packages/remix-react/index.tsx b/packages/remix-react/index.tsx index 50571ac7591..ad42a903d75 100644 --- a/packages/remix-react/index.tsx +++ b/packages/remix-react/index.tsx @@ -1,5 +1,3 @@ -export type { RemixBrowserProps } from "./browser"; -export { RemixBrowser } from "./browser"; export type { ErrorResponse, Fetcher, @@ -52,7 +50,16 @@ export { unstable_usePrompt, unstable_useViewTransitionState, } from "react-router-dom"; +export { + // For use in clientLoader/clientAction + defer, + json, + redirect, + redirectDocument, +} from "@remix-run/server-runtime"; +export type { RemixBrowserProps } from "./browser"; +export { RemixBrowser } from "./browser"; export type { AwaitProps, RemixNavLinkProps as NavLinkProps,