Skip to content

Commit

Permalink
fix: ref外抛submit函数 (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
mengshang918 committed Dec 30, 2021
1 parent 27637df commit 6ceffa7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/drip-form/src/DripForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: jiangxiaowei
* @Date: 2020-05-14 16:54:32
* @Last Modified by: jiangxiaowei
* @Last Modified time: 2021-12-30 13:59:27
* @Last Modified time: 2021-12-30 18:12:44
*/
import React, {
forwardRef,
Expand Down Expand Up @@ -227,7 +227,7 @@ const DripForm = forwardRef<DripFormRefType, DripFormRenderProps>(

// 提交表单
const submit = useCallback<DripFormRefType['submit']>(
() => () =>
() =>
new Promise((resolve) => {
if (checking === false) {
resolve({
Expand Down
2 changes: 1 addition & 1 deletion packages/drip-form/src/DripForm/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export type DripFormRenderProps = {
*/
export type DripFormRefType = {
reset: () => void
submit: () => () => Promise<{
submit: () => Promise<{
formData: Record<string, any>
errors: Map
}>
Expand Down

0 comments on commit 6ceffa7

Please sign in to comment.