antd
4.x
冗余形式:
import React from 'react';
import { Form } from "antd"
function MyForm({ handleSubmit }) {
return(
<Form onSubmit={handleSubmit}>
<Field
name="firstName"
label="Name on the card"
component={'input'}
required
/>
<Field
name="lastName"
label="Name on the card"
component={'input'}
required
/>
<Button type="primary" htmlType="submit" > Save </Button>
</Form>
)
}
MyForm = connect()(MyForm);
MyForm = reduxForm({
form: 'MyForm'
})(MyForm);
export default MyForm;
问题:
如果我使用antd,则提交不起作用
<Form>
标签,用onFinish尝试,没有运气
如果替换为html,则工作正常
<form>
标签,但样式会断裂。