v1.7.4
What Changed
Patch Changes
-
You can now infer the type of the
.dataproperty of fetchers from youractionandloaderfunctions. This works similarly to our type inference ofuseLoaderDataby providing the type of theactionorloaderfunction at theuseFetchercall 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-POSTsubmissions
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