What Changed
Patch Changes
-
You can now infer the type of the
.data
property of fetchers from youraction
andloader
functions. This works similarly to our type inference ofuseLoaderData
by providing the type of theaction
orloader
function at theuseFetcher
call site.export async function loader(args: LoaderArgs) { return json({ user: { name: "Chance", twitter: "@chancethedev", age: 36, }, }); } function SomeComponent() { let fetcher = useFetcher<typeof loader>(); if (fetcher.data) { let userName = fetcher.data.user.name; // string let userAge = fetcher.data.user.age; // number } }
-
Fixed a bug in
<Form>
that prevented the correct method from being called with non-POST
submissions
Changes by package
New Contributors
- @michaelhelvey made their first contribution in #4392
- @maxschwarzmueller made their first contribution in #4413
Full Changelog: v1.7.3...v1.7.4