I'm building an autosave feature to my form built with remix Form. I added pending states by checking transition.submission from useTransition() and it worked like the doc examples.
However, if I triggered the submission dynamically, via requestSubmit formRef?.current?.requestSubmit(document?.getElementById("submitButton")), everything works... except the transition won't show a pending submission.
I could solve this by adding setting an extra useState for the autosave, but that's redundant code I'd like to avoid. Is there a better way I could autosave that would hook into remix lifecycle correctly?
note formRef.current.submit() doesn't work, because it ignores onSubmit and doesn't carry any submit button values with it.