-
-
Notifications
You must be signed in to change notification settings - Fork 173
Description
Clear and concise description of the problem
The design of these are simple. "valueField" "textField" "disabledField" all are the result of a simplistic JS runtime structure. They can simply match items in the array of objects.
This however has typescript drawbacks, and opens up to runtime errors while not having a significant reason for its existence. People simply need to preprocess their data beforehand, simply using computed with Array.map. So on the user side, it's a simple, but adds boilerplate. The main benefit is making it less prone to errors.
Suggested solution
We remove those dynamic fields and require an exact structure. We remove our excess resolving as we would know, for certain, about various options existence.
Alternative
Continue the way it is and be less type safe. Truth is, the few input components that inherit these props and their resolution, are among the only few components that behave like that. Most components are pretty type safe in their structure, which begs the question on why these ones aren't built with safety in mind.