Skip to content

Commit

Permalink
fix: fix controller updateStore method (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
bocembocem authored Jan 25, 2024
1 parent f17b426 commit ef5bab2
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/lib/core/components/Form/Controller/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,13 @@ export const updateStore = <
state: store.state,
};

if (updateState) {
nextStore = methodOnChange(nextStore, {
valOrSetter: (value) =>
valueMutatorUpdated ? (valueMutator as {value: DirtyValue}).value : value,
...(errorMutatorUpdated
? {errorMutator: (errorMutator as {value: BaseValidateError}).value}
: {}),
});
}
nextStore = methodOnChange(nextStore, {
valOrSetter: (value) =>
valueMutatorUpdated ? (valueMutator as {value: DirtyValue}).value : value,
...(errorMutatorUpdated
? {errorMutator: (errorMutator as {value: BaseValidateError}).value}
: {}),
});

setStore(nextStore);
} else if (updateNonCritical) {
Expand Down

0 comments on commit ef5bab2

Please sign in to comment.