Reputation: 749
I am creating a simple subscribe form which has two input email and interest. After submission user receives a thank you message in place of the form. My question is should I use "Route" to achieve that functionality or is there any better way.
First screen
Afte submitting form
Is there any better approach to switch component on form submission. Can someone point me in the right direction ROUTE or conditional switch component.
Upvotes: 0
Views: 37
Reputation: 174
If you take approach of component(izing) your react application, ideally your above FORM component should handle all scenarios e.g. showing initial form view, error handling, and successful form submission etc. cases conditionally.
Upvotes: 1