forge42dev / remix-hook-form

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

FYI: v5.0.0 breaks <form> if method was not specified #104

Closed msevestre closed 1 month ago

msevestre commented 2 months ago

WIth 4.x, default method of Remix (get) was overwritten somehow and became POST after update to 5.x it becomes get and breaks all form where this was not specified explicitly Probably good to have this in the release notes because this is a massive breaking change that is hinted but not quite clear

AlemTuzlak commented 1 month ago

@msevestre Actually the behavior was not intended to change drastically, after an investigation it turns out that Remix Form element always sets the method on the form element even if it is not provided as a prop which changed this behavior. I will see if there is a way to check if the prop is explicitly set or not but in any case you can just set the method to be post if you have some sort of custom wrapper around the useForm hook

msevestre commented 1 month ago

@AlemTuzlak Agreed. Just that the behavior changed when we updated to 5.0.0 and some action broke (reset password in our case where the method was not set explicitly and became get instead of post)