Skip to content

Conversation

DutchBen
Copy link
Collaborator

@DutchBen DutchBen commented Jul 30, 2025

Some loosely related changes in this PR:

  • Adds 'shouldUnregister = true' property to useForm call to fix bug where stale data was added when submitting form
  • Removes 'rfh' parameter from useGetZodValidator call since it's unused. Removed from a lot of downstream calls aswell.
  • Removes some unused legacy props and functions originally introduced by Jonas
  • Removes hardcoded translations in favor of standard locales provided by Zod

@DutchBen DutchBen merged commit 5cd1db5 into main Jul 30, 2025
3 checks passed
// Note. If we don't use cloneDeep here we are adding a reference to the rhfValues
// that changes on every change in the form and triggering effects before we want to.
addFormInputData(_.cloneDeep(rhfValues), !!errorDetails);
window.scrollTo(0, 0);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it important for the submit action to scroll the window?

// TODO implement save with errors toggle
if (data) {
rhf.clearErrors();
submitFormFn();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically a retry, right? Which kind of client side errors can lead to this function?

formInputData,
hasNext,
initialData,
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's.. a lot :)

Any way to structure this a bit more, maybe group similar state things together? (feel free to ignore)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants