Skip to content

Releases: code-forge-io/remix-hook-form

remix-hook-form@7.2.0

01 Jun 12:51
6e7f210

Choose a tag to compare

Minor Changes

  • 056c49a: Fix type errors with react-hook-form 7.75.0. FormState gained an isReady field and UseFormReturn gained setValues in 7.75; the wrapped formState now exposes isReady (preserving the lazy getter behavior) and setValues flows through the hook's return type. Resolves the "Property 'setValues'/'isReady' is missing" errors (#180).

v7.1.1

21 Oct 10:22

Choose a tag to compare

Full Changelog: v7.0.2...v7.1.1

v7.0.2

21 Oct 10:11
d718447

Choose a tag to compare

What's Changed

  • Fix isSubmitting state value when using encType application/json by @BobReid in #170
  • Fix: Multiple File Input by @phyziyx in #174

New Contributors

Full Changelog: v7.0.1...v7.0.2

v7.0.1

09 Apr 10:46
7523369

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v7.0.0...v7.0.1

v7.0.0

05 Apr 11:51

Choose a tag to compare

Middleware mode

From v7 you can use middleware to extract the form data and access it anywhere in your actions and loaders.
All you have to do is set it up in your root.tsx file like this:

import { unstable_extractFormDataMiddleware } from "remix-hook-form/middleware";

export const unstable_middleware = [unstable_extractFormDataMiddleware()];

And then access it in your actions and loaders like this:

import { getFormData, getValidatedFormData } from "remix-hook-form/middleware";

export const loader = async ({ context }: LoaderFunctionArgs) => {
  const searchParamsFormData = await getFormData(context); 
  return { result: "success" };
};
export const action = async ({ context }: ActionFunctionArgs) => {
  // OR:   const formData = await getFormData(context); 
  const { data, errors, receivedValues } = await getValidatedFormData<FormData>(
    context,
    resolver,
  );
  if (errors) {
    return { errors, receivedValues };
  } 
  return { result: "success" };
};

What's Changed

New Contributors

Full Changelog: v6.2.0...v7.0.0

v6.2.0

03 Apr 15:39
3d63a88

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v6.1.3...v6.2.0

v6.1.3

21 Jan 16:29

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v6.1.2...v6.1.3

v6.1.2

05 Jan 17:13

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v6.1.1...v6.1.2

v6.1.1

05 Jan 17:09
bc65d42

Choose a tag to compare

What's Changed

Full Changelog: v6.1.0...v6.1.1

v6.1.0

12 Dec 11:20

Choose a tag to compare

getValidatedFormData typing fix

getValidatedFormData now properly returns the types instead of any

What's Changed

Full Changelog: v6.0.0...v6.1.0