hey all, I am struggling to implement a design that has the submit button for a form essentially in the parent.
the markup essentially boils down to something like:
div menubar form
div menubar form
A button in the menu bar can submit the form, and it should be disabled if the form is dirty, etc.
I’m achieving the submission via passing a ref. Which feels hacky. But I can’t get “is dirty?” and other form lifecycle events easily.
I also don’t want to pull up the state because menubar is reasonably far up in the tree and I want the form to be reusable in different places or with different actions.
Any patterns for doing this well? I’m using Formik if it matters.