File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ export function useInnerContext(skip?: boolean) {
225225export default function useFormState < T > (
226226 initialState : T ,
227227 options ?: {
228- enhance ?: ( newState : T ) => T ;
228+ enhance ?: ( newValues : T , extra : { previousValues : T } ) => T ;
229229 onChange ?: (
230230 newState : T ,
231231 extra : {
@@ -358,7 +358,7 @@ export default function useFormState<T>(
358358 let enhancedV = h ?. enhance ? h ?. enhance ( v , values ) : v ;
359359 const newValues = deepSet ( values , k , enhancedV ) as T ;
360360 const enhancedNewValues = options ?. enhance
361- ? options ?. enhance ( newValues )
361+ ? options ?. enhance ( newValues , { previousValues : values } )
362362 : newValues ;
363363
364364 ( h as Customizing < T , K > ) ?. onChangeText ?.( enhancedV as any ) ;
You can’t perform that action at this time.
0 commit comments