How to handle multiple forms on one page? #250
-
How to handle the case where you have multiple forms on one page? For example, let's say you have a button to log in via email and one to log in via Google. How would your code look like then? They'll all be handled by the same action, so that part is fine, but what about the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You can check these 2 approaches I shared on #37 with one using action with a custom search and the other uses a hidden input. You will need to call However, for your example with social login, it would be more common to setup an action for each social login you want to support. You can find some examples from remix-auth-socials. Feel free to ask on the Remix discord if you need further assistance. :) |
Beta Was this translation helpful? Give feedback.
You can check these 2 approaches I shared on #37 with one using action with a custom search and the other uses a hidden input. You will need to call
useForm
hook for each form as demonstrated in the codesandbox.However, for your example with social login, it would be more common to setup an action for each social login you want to support. You can find some examples from remix-auth-socials. Feel free to ask on the Remix discord if you need further assistance. :)