forge42dev / remix-hook-form

Open source wrapper for react-hook-form aimed at Remix.run
MIT License
330 stars 27 forks source link

fix: add passthrough options to reset #74

Closed Roanmh closed 7 months ago

Roanmh commented 7 months ago

This aligns the interface of the reset method returned by useRemixForm with the method from useForm

Description

Expose the options that React Hook Form allows for the reset function to consumers of useRemixForms

Fixes #73

If this is a new feature please add a description of what was added and why below:

Allows user to specify options to reset method.

Type of change

New feature (non-breaking change which adds functionality).

I did not edit the docs as reset() is not mentioned in them. Perhaps it should be though.

How Has This Been Tested?

Used in my project. Options are typed correctly, and I saw the expected change in behavior from keepErrors, keepValues, and keepDirty.

Happy to elaborate more. I also skipped unit tests for now.

Checklist: