I have a simple html form in Next JS 14.2.2 (app router) application. The form has two submit buttons, lets says Button1 and Button2. I am using useFormStatus hook from react-dom to handle the loading indicator in each of the submit buttons.
When I am submitting the form by clicking on Button1, the loading indicator starts for both the buttons. I want only specific button to show loading indicator which was clicked.
How can we handle this ?
I tried using name parameter on each of the buttons but that information is not present in the formStatus variable available from useFormStatus hook
Sanjay Pandit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.