department-of-veterans-affairs / va-mobile-library

https://department-of-veterans-affairs.github.io/va-mobile-library/
ISC License
1 stars 0 forks source link

DS - Determine scope of form system #231

Closed narin closed 1 month ago

narin commented 6 months ago

Description

In the app, there is a FormWrapper component which often surrounds other form components. This FormWrapper provides additional functionality to handle validation, setting error states, maintaining a list of errors, displaying error messages, resetting errors, and handling save/submit. The FormWrapper also allows engineers to pass a set of props and render the form elements for them.

We should determine if we want to provide a similar type of FormWrapper component, or simply provide the form components themselves with an styling for error states. Including a FormWrapper type component would significantly increase the complexity and scope of providing a form, and venture into the territory of maintaining/providing a "form system".

Acceptance Criteria

narin commented 1 month ago

Documenting pros/cons of either providing form components only or developing a form system below:

Form Components Only

Pros

Form System

Pros

After discussing in our touchpoint with @rtwell on 7/31, we decided we'll reach out to Matt Dingee for his thoughts. We also decided it might be best to start with the components only, and provide usage guidance in our docs instead of enforcing a form system.