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
|`useFormDataIfPresent`| Legacy behavior - Do not merge defaults if there is a value for a field in `formData` even if that value is explicitly set to `undefined`|
271
271
|`useDefaultIfFormDataUndefined`| If the value of a field within the `formData` is `undefined`, then use the default value instead |
272
-
|`useDefault`| Always use the default value instead of form data |
272
+
|`useDefaultAlways`| Always use the default value instead of form data |
/** Merges the `defaults` object of type `T` into the `formData` of type `T`
@@ -20,25 +20,24 @@ import isNil from 'lodash/isNil';
20
20
* @param [formData] - The form data into which the defaults will be merged
21
21
* @param [mergeExtraArrayDefaults=false] - If true, any additional default array entries are appended onto the formData
22
22
* @param [defaultSupercedesUndefined=false] - If true, an explicit undefined value will be overwritten by the default value
23
-
* @param [overrideFormDataWithDefaultsStrategy='noop'] - If not 'noop', the default value will overwrite the form data value. Values can be either replaced or merged, if the value
24
-
* doesn't exist in the default, we take it from formData and in the case where the value is set to undefined in formData.
25
-
* This is useful when we have already merged formData with defaults and want to add an additional field from formData
26
-
* that does not exist in defaults.
23
+
* @param [overrideFormDataWithDefaultsStrategy=OverrideFormDataStrategy.noop] - Strategy for merging defaults and form data
27
24
* @returns - The resulting merged form data with defaults
/** Strategy for merging defaults with existing form data */
1271
+
exportenumOverrideFormDataStrategy{
1272
+
/** No merge or override applied */
1273
+
noop,
1274
+
/** If the value doesn't exist in the default, we take it from formData and in the case where the value is set to undefined in formData.
1275
+
* This is useful when we have already merged formData with defaults and want to add an additional field from formData that does not exist in defaults */
0 commit comments