Skip to content

Commit 1278ea3

Browse files
authored
refactor(@uform/core): update onFormSubmit position (#464)
1 parent 4e0a719 commit 1278ea3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,8 @@ export function createForm<FieldProps, VirtualFieldProps>(
802802
}
803803
return Promise.reject(validated.errors)
804804
}
805+
heart.publish(LifeCycleTypes.ON_FORM_SUBMIT, state)
805806
if (isFn(onSubmit)) {
806-
heart.publish(LifeCycleTypes.ON_FORM_SUBMIT, state)
807807
return Promise.resolve(
808808
onSubmit(state.getState(state => clone(state.values)))
809809
).then(payload => ({ validated, payload }))

0 commit comments

Comments
 (0)