diff --git a/components/form/demo/basic.tsx b/components/form/demo/basic.tsx index 087d2b88b3..1f0c76a068 100644 --- a/components/form/demo/basic.tsx +++ b/components/form/demo/basic.tsx @@ -1,13 +1,5 @@ import React from 'react'; -import { Button, Checkbox, Form, Input } from 'antd'; - -const onFinish = (values: any) => { - console.log('Success:', values); -}; - -const onFinishFailed = (errorInfo: any) => { - console.log('Failed:', errorInfo); -}; +import { Button, Checkbox, Form, type FormProps, Input } from 'antd'; type FieldType = { username?: string; @@ -15,6 +7,14 @@ type FieldType = { remember?: string; }; +const onFinish: FormProps["onFinish"] = (values) => { + console.log('Success:', values); +}; + +const onFinishFailed: FormProps["onFinishFailed"] = (errorInfo) => { + console.log('Failed:', errorInfo); +}; + const App: React.FC = () => (