Releases: forge-42/remix-hook-form
Releases · forge-42/remix-hook-form
v7.0.1
v7.0.0
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
- Update Readme code examples to align with React Router 7 by @LeoDanielsson in #163
New Contributors
- @LeoDanielsson made their first contribution in #163
Full Changelog: v6.2.0...v7.0.0
v6.2.0
What's Changed
- Docs improvement to clarify when submitData hook option is ignored by @melanieseltzer in #153
- Update git organizations to forge-42 by @beeman in #158
- Update peer dep to support new types by @AlemTuzlak in #160
New Contributors
- @melanieseltzer made their first contribution in #153
- @beeman made their first contribution in #158
Full Changelog: v6.1.3...v6.2.0
v6.1.3
v6.1.2
What's Changed
- Remove basename from submit target action by @david-szabo97 in #144
New Contributors
- @david-szabo97 made their first contribution in #144
Full Changelog: v6.1.1...v6.1.2
v6.1.1
v6.1.0
getValidatedFormData typing fix
getValidatedFormData now properly returns the types instead of any
What's Changed
- Fix for getValidatedFormData by @AlemTuzlak in #138
Full Changelog: v6.0.0...v6.1.0
v6.0.0 - React Router v7
React Router v7
The version 6 of remix-hook-form and onwards now works on react-router v7+ and is not remix specific anymore! If you're using remix you can stay on older versions until you're ready to upgrade
What's Changed
New Contributors
Full Changelog: v5.1.1...v6.0.0
v5.1.1
Fixes #114
Fixes #113
Full Changelog: v5.1.0...v5.1.1
v5.1.0
What's Changed
Fixes #105
- Chore: fix prettier npm scripts by @vmosyaykin in #110
- Improve defaultValue prop resolution by @vmosyaykin in #109
- fix for undefined handling by @AlemTuzlak in #112
New Contributors
- @vmosyaykin made their first contribution in #110
Full Changelog: v5.0.4...v5.1.0