Releases: forge42dev/remix-hook-form
v5.0.0
remix-hook-form respects Form
element props
From v5 onwards remix-hook-form will respect your
component props, namelyencType
and method
props which will allow you to not use submitConfig and rely on these props, also this will improve the Progessive enhancement aspect because the form would still work without JS the same way.
Submitting JSON data now works
There was an issue with remix-hook-form where it submitted json form data as actual FormData
, this is resolved with v5.
README updates
README now includes a working example of submitting files.
getValidatedFormData
now takes in FormData
Before this release it only took in requests, now you can pass in formData and it will work the same as before.
What's Changed
- Update README.md by @devstojko in #91
- docs(README): fix typo in defaultValues by @machour in #95
- The one where you can change the encType by @AlemTuzlak in #98
New Contributors
- @devstojko made their first contribution in #91
- @machour made their first contribution in #95
Full Changelog: v4.3.0...v5.0.0
v4.3.0
What's Changed
- Fix extra re-renders caused by formState changes by @ekerik220 in #86
New Contributors
- @ekerik220 made their first contribution in #86
Full Changelog: v4.2.0...v4.3.0
v4.2.0
v4.1.0
What's Changed
- fix: replace deprecated zod method in readme by @geeron in #68
- docs: update readme and specify install of react-hook-form by @geeron in #70
- fix: add passthrough options to reset by @Roanmh in #74
- feat: added handling for date in createFormData by @TheYoxy in #67
New Contributors
- @geeron made their first contribution in #68
- @Roanmh made their first contribution in #74
- @TheYoxy made their first contribution in #67
Full Changelog: v4.0.0...v4.1.0
v4.0.0
Error handling
From version 4.0.0 remix-hook-form now uses react-hook-form native errors
prop instead of merging frontend and backend errors which should allow for consistent behavior across the two packages and this brings us one step closer to the original implementation
What's Changed
- Improve
getValidatedFormData
type inference by @mintchkin in #61 - README fixes & updates by @MonsterDeveloper in #57
New Contributors
- @mintchkin made their first contribution in #61
- @MonsterDeveloper made their first contribution in #57
Full Changelog: v3.2.1...v4.0.0
v3.2.1
File upload example
I've added a file upload example and how it works on the server side and how you can parse files.
Bug fix for fetcher typing
What's Changed
- 44 missing blob type check to file upload v3 by @AlemTuzlak in #47
- #49 - Type fix by @AlemTuzlak in #50
- 51 type error when passing in fetcher by @AlemTuzlak in #53
Full Changelog: v3.0.3...v3.2.1
v3.0.3
Bug fixes
Fixed a lot of smaller issues and bugs that have arisen from the removal of JSON.stringify()
Full Changelog: v3.0.0...v3.0.3
v3.0.0
Form data submission rework
Earlier versions of remix-hook-form were using the following method to store formData to be sent to the server:
const data = yourClientData;
const formData = new FormData();
formData.set("formData", JSON.stringify(data));
submit(formData);
The problems with this approach were two fold:
- it caused URL's to be very ugly if used in combination with GET
- it didn't allow you to submit files
Well I've decided to do a complete rework and changed it to work like so:
const data = yourClientData;
const formData = new FormData();
Object.entries(data).map(helper)
submit(formData);
The important thing in the change is that it converts arrays, objects, numbers and booleans to strings before setting it into form data because it supports only string but another thing is that it appends files now so you can do file submissions with remix-hook-form.
File upload support
This has been requested for a while and has been added with this release. The only caveat is that you need to handle the file parsing on the server yourself. Remix-hook-form could, but won't provide a custom implementation for unstable_parseMultiPartFormData
but that could lead to issues where the package doesn't support every deployment target so you will have to handle this part on your own!
What's Changed
- Remix v2 support by @AlemTuzlak in #27
- version 3.0.0 by @AlemTuzlak in #41
Full Changelog: v2.0.0...v3.0.0
v2.0.0 - ESM support
ESM support!
From version 2.0.0 you can use remix-hook-form in both ESM and CJS fully typed!
Full Changelog: v1.2.3...v2.0.0
v1.2.3
isSubmitting enhancement
From v1.2.3 isSubmitting will be true until your action returns a response/redirects or until your fetcher is idle again when you submit your form instead of being true as soon as the validation on the client passes
What's Changed
- #22 - Is submitting change by @AlemTuzlak in #23
Full Changelog: v1.2.2...v1.2.3