From 75321d3e19a62268b4efc5bc1ade0b7e53bcb390 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Mon, 29 Apr 2024 09:20:06 -0400 Subject: [PATCH] Add undefined to useActionData type override (#9322) --- .changeset/happy-ladybugs-smoke.md | 5 +++++ packages/remix-react/future/single-fetch.d.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/happy-ladybugs-smoke.md diff --git a/.changeset/happy-ladybugs-smoke.md b/.changeset/happy-ladybugs-smoke.md new file mode 100644 index 00000000000..2d8f4ca7bef --- /dev/null +++ b/.changeset/happy-ladybugs-smoke.md @@ -0,0 +1,5 @@ +--- +"@remix-run/react": patch +--- + +Add `undefined` to `useActionData` type override diff --git a/packages/remix-react/future/single-fetch.d.ts b/packages/remix-react/future/single-fetch.d.ts index 5356fcb7be6..ddef3d7098c 100644 --- a/packages/remix-react/future/single-fetch.d.ts +++ b/packages/remix-react/future/single-fetch.d.ts @@ -1,4 +1,4 @@ -import type { MetaArgs, UNSAFE_MetaMatch } from "@remix-run/react"; +import type { MetaArgs, UIMatch, UNSAFE_MetaMatch } from "@remix-run/react"; import type { LoaderFunctionArgs, ActionFunctionArgs, @@ -57,7 +57,7 @@ declare module "@remix-run/react" { : never; export function useActionData(): T extends ActionFunction_SingleFetch - ? SingleFetchSerialize_V2 + ? SingleFetchSerialize_V2 | undefined : never; export function useRouteLoaderData(