Created
April 27, 2020 20:12
-
-
Save annacoding2020/219bc838f7a51ade1d5ed814d05de798 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'React' | |
| import { Form, Input, Button } from 'antd'; | |
| import { UserOutlined } from '@ant-design/icons'; | |
| const SubmitButtonInsideForm = () => { | |
| const onFinish = values => { | |
| console.log('Received values of form: ', values); | |
| }; | |
| return ( | |
| <Form | |
| name="normal_login" | |
| className="login-form" | |
| initialValues={{ remember: true }} | |
| onFinish={onFinish} | |
| > | |
| <Form.Item | |
| name="username" | |
| rules={[{ required: true, message: 'Please input your Username!' }]} | |
| > | |
| <Input prefix={<UserOutlined className="site-form-item-icon" />} placeholder="Username" /> | |
| </Form.Item> | |
| <Form.Item> | |
| <Button type="primary" htmlType="submit" className="login-form-button"> | |
| Log in | |
| </Button> | |
| </Form.Item> | |
| </Form> | |
| ); | |
| }; | |
| export default SubmitButtonInsideForm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment