Skip to content

Commit f60dd14

Browse files
feat: add extra handlers to raw input
1 parent eb247e5 commit f60dd14

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/useFormState.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,14 @@ export default function useFormState<T>(
340340
h: Customizing<T, K> | CustomizingRaw<T, K> | undefined
341341
) => {
342342
let enhancedV = h?.enhance ? h?.enhance(v, valuesRef.current) : v;
343-
344343
const newValues = deepSet(valuesRef.current, k, enhancedV) as T;
345-
setValues(newValues);
346-
checkError(k, h, enhancedV, valuesRef.current);
347344

348345
(h as Customizing<T, K>)?.onChangeText?.(enhancedV as any);
349346
(h as CustomizingRaw<T, K>)?.onChange?.(enhancedV as any);
347+
348+
setValues(newValues);
349+
checkError(k, h, enhancedV, valuesRef.current);
350+
350351
// prevent endless re-render if called on nested form
351352
// TODO: not needed anymore probably test it out
352353
setTimeout(() => {

0 commit comments

Comments
 (0)