When you are building a Single Page Application, the one of the most important things you have to consider is the forms.
In our project we have a custom-made set of input components such us dropdowns, toggles, switches etc. We also created a bunch of elements such us pagination, tabs, accordions, similar to Bootstrap. In most cases we use Bootstrap components, but we liked the idea of having the optiom to switch libraries without changing code.
Are you using components or stores/reducers to validate your forms?
Currently our stores are responsible to handle validation state in our forms. We normalize every single input in order to add validation state, such us if the filed is required or if it's currently valid. Every time the user types something or changes something, we evaluate the data and then we change these flags according to the result. In this way we can find if a form is valid or not, from anywhere in our application. But we aren't sure if this is a good practice because we spend a lot of time debugging the store.
We found redux-form and we really appreciated the work they made. But we found that the community is going to make some changes in their API. We didn't want to depend on a library which is currently under development. We are thinking to create our own components to handle validation in forms.
Which is your favorite validation technique?
Juho Vepsäläinen
SurviveJS
JSON Schema is easily one of my favorite specifications. You can use it to describe your fields and their validation constraints. This information is enough to generate forms that are able to validate themselves. In the past I used the predecessor of react-json-editor successfully and it saved me from a lot of coding.
This is the direction I would look into. There could be some gotchas, but if it fits your use case, it could be nice. If you describe your API using a definition such as OpenAPI (formerly Swagger), you can generate forms with very little code. That's particularly handy for CRMs and such. And best of all your backend and frontend will stay in sync as the backend changes somehow.