0.8.0 • Published 3 years ago
@mgcrea/antd-hook-form v0.8.0
antd-hook-form
Features
- Provides a <Form />component that enables you to use react-hook-form with AntDesign
- Replaces the default AntDesign field-form form handling
- Written from the ground up with TypeScript
Docs
Install
npm install @mgcrea/antd-hook-formQuickstart
import React from 'react';
import {Form, FormProps} from '@mgcrea/antd-hook-form';
function App() {
  const onSubmit = (data) => console.log(data);
  return (
    <Form labelCol={{span: 4}} wrapperCol={{span: 14}} layout="horizontal" onSubmit={onSubmit}>
      <Form.Item name="input1" label="Input">
        <Input />
      </Form.Item>
      <Form.Row wrapperCol={{span: 14, offset: 4}}>
        <Button htmlType="submit">Button</Button>
      </Form.Row>
    </Form>
  );
}