newforms icon indicating copy to clipboard operation
newforms copied to clipboard

Externalising form state

Open insin opened this issue 11 years ago • 0 comments

There's a cost associated with constantly recreating new form instances in that YourForm.prototype.baseFIelds gets deep -cloned to yourFormInstance.fields by the BaseForm constructor.

Having a means of externalising a form's working state would give the opportunity to avoid this where possible, plus make it easier to implement shouldComponentUpdate() when necessary by doing a === on the state object by recreating it every time it needs to change.

This would also enable using a single Form instance to validate & render multiple foirms. Reusing a single form instance could be a win for FormSets on the client.

insin avatar Mar 11 '14 11:03 insin