trax-retail / react-form-builder

A Form Builder for React.js (deprecated)
MIT License
53 stars 9 forks source link

Use metaData and formData #5

Open polmiro opened 10 years ago

polmiro commented 10 years ago

Sometimes we use the formData to transfer information thorough the form structure that is not actually relevant. Some examples would be:

I think it would be ideal to have a metaData data object that is transferred to the input elements, this can be updated by DataSourcedMixin, and then other form elements can react to those changes.

polmiro commented 10 years ago

This is related to making the form components immutable. All they would do is propagate a pair(metadataKey, value) to the parent component

polmiro commented 10 years ago

Metadata should also be used in DataSourcedMixin.

Instead of storing "options" and other sourced data as state, we should propagate it to the parent component (as we do with formData).

I'm still not certain where the data resolution should be done. Whether pass "formData" + "dataKey" down the line or just pass the "data" itself. (same thing regarding metadata).