Creating a schema-based form system
The Tao of React - don't hardcode markup
Hey there! Happy Monday.
I wrote an article:
Creating a Schema-Based Form System
Writing forms as a front end developer can get pretty tedious, but bad abstractions are even worse. In this article, I describe how to make a system where you define a schema upfront and pass it into a component that handles values, errors, validation, dirty state, and submission.
Hope you enjoy it! This is a good practice to follow in general on the front end - try to put as much as you can in a data format as opposed to hardcoding markup. This is one of the tips outlined in the tao of React.
I also added a sepia theme to my website for those of you (like me) who can’t look at a bright white screen for too long, along with some other tweaks.
Have a great week!