You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently use the useForm hook across the Hexabot frontend, often repeating the same logic for registering fields, applying validation rules, and managing default values. To improve both developer experience and type safety, I propose introducing two new helper hooks:
🔧 Proposed Enhancement
useStrictForm:
A strongly typed version of useForm that enforces field names and types from a provided schema/interface. It can also:
Accept default values
Accept validation rules
Improve intellisense and reduce boilerplate
useStrictRegister:
A wrapper for register that only allows registering known, typed fields. This will prevent accidental field name typos and help maintain consistency across forms.
✅ Benefits
Centralized logic for default values and validation rules
Stronger TypeScript support with clear typing for field names and values