react-hook-form 7.46.2 → 7.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -199,15 +199,13 @@ var shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, is
199
199
 
200
200
  var convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);
201
201
 
202
- var shouldSubscribeByName = (name, signalName, exact) => exact && signalName
203
- ? name === signalName ||
204
- (Array.isArray(name) &&
205
- name.some((currentName) => currentName && exact && currentName === signalName))
206
- : !name ||
207
- !signalName ||
208
- name === signalName ||
209
- convertToArrayPayload(name).some((currentName) => currentName &&
210
- (currentName.startsWith(signalName) ||
202
+ var shouldSubscribeByName = (name, signalName, exact) => !name ||
203
+ !signalName ||
204
+ name === signalName ||
205
+ convertToArrayPayload(name).some((currentName) => currentName &&
206
+ (exact
207
+ ? currentName === signalName
208
+ : currentName.startsWith(signalName) ||
211
209
  signalName.startsWith(currentName)));
212
210
 
213
211
  function useSubscribe(props) {
@@ -436,11 +434,13 @@ function useController(props) {
436
434
  };
437
435
  }, [name, control, isArrayField, shouldUnregister]);
438
436
  React.useEffect(() => {
439
- control._updateDisabledField({
440
- disabled,
441
- fields: control._fields,
442
- name,
443
- });
437
+ if (get(control._fields, name)) {
438
+ control._updateDisabledField({
439
+ disabled,
440
+ fields: control._fields,
441
+ name,
442
+ });
443
+ }
444
444
  }, [disabled, name, control]);
445
445
  return {
446
446
  field: {
@@ -2266,8 +2266,10 @@ function createFormControl(props = {}, flushRootRender) {
2266
2266
  ? _formState.touchedFields
2267
2267
  : {},
2268
2268
  errors: keepStateOptions.keepErrors ? _formState.errors : {},
2269
+ isSubmitSuccessful: keepStateOptions.keepIsSubmitSuccessful
2270
+ ? _formState.isSubmitSuccessful
2271
+ : false,
2269
2272
  isSubmitting: false,
2270
- isSubmitSuccessful: false,
2271
2273
  });
2272
2274
  };
2273
2275
  const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues)