Skip to content

v1.7.4

Compare
Choose a tag to compare
@chaance chaance released this 27 Oct 19:21
· 2961 commits to main since this release

What Changed

Patch Changes

  • You can now infer the type of the .data property of fetchers from your action and loader functions. This works similarly to our type inference of useLoaderData by providing the type of the action or loader function at the useFetcher 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


Full Changelog: v1.7.3...v1.7.4