Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS Error : Property 'useForm' does not exist on type 'FC<FormBuilderInterface> #104

Open
matart15 opened this issue Jul 26, 2021 · 3 comments

Comments

@matart15
Copy link

just installed and copied example code

npm install --save-dev antd-form-builder

import React from 'react'
import { Form, Button } from 'antd'
import FormBuilder from 'antd-form-builder'

export default () => {
  const [form] = FormBuilder.useForm()
  const meta = {
    fields: [
      { key: 'username', label: 'User Name' },
      { key: 'password', label: 'Password', widget: 'password' },
    ],
  }

  return (
    <Form form={form}>
      <FormBuilder meta={meta} form={form} />
      <Form.Item wrapperCol={{ span: 16, offset: 8 }}>
        <Button type="primary">Login</Button>
      </Form.Item>
    </Form>
  )
}
@afeiship
Copy link
Contributor

@matart15

  throw new Error('FormBuilder.useForm is removed. Please use Form.useForm().')

https://github.com/rekit/antd-form-builder/blob/master/src/FormBuilder.js#L143

@matart15
Copy link
Author

Oh. I see. Thank you

@matart15
Copy link
Author

Looks like Readme have an old code.

SpadarShut added a commit to SpadarShut/antd-form-builder that referenced this issue Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants