I have no choice but to call the getter's submit method in the handler. It's accessing the correct action method in the router, but I can't pass that method to the action, which ismethod='POST
defined in the form. How do I access thefetch.Form
method inside the handler?
const fetcher = useFetcher() const handlerLogin = useCallback(async () => { console.log(fetcher.formMethod) //-> outputting undefined fetcher.submit({ value: 'social' }, { method: fetcher.formMethod }) },[]) return (..............
Try this solution, passing the method to the
handlerLogin
function: