I have tried to solve #13 with adding defaultValue: '' to every not null field, but to my surprise it forced those fields to be null, even if there was data in the input for the field.
The name defaultValue implies to set the value when none was present - either the field is new (not in the input) OR the input field is there, but its value is NULL).
defaultValue is better named setValue, constantValue or simply value, as it is replacing the value unconditionally with the one specified.
Probably it is worth having both value and defaultValue as they are used in different situations.
I have tried to solve #13 with adding
defaultValue: ''
to every not null field, but to my surprise it forced those fields to be null, even if there was data in the input for the field.The name
defaultValue
implies to set the value when none was present - either the field is new (not in the input) OR the input field is there, but its value is NULL).defaultValue
is better namedsetValue
,constantValue
or simplyvalue
, as it is replacing the value unconditionally with the one specified.Probably it is worth having both
value
anddefaultValue
as they are used in different situations.