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

Uncaught TypeError: form.getFieldsValue is not a function #109

Open
wahello opened this issue Sep 18, 2021 · 2 comments
Open

Uncaught TypeError: form.getFieldsValue is not a function #109

wahello opened this issue Sep 18, 2021 · 2 comments

Comments

@wahello
Copy link

wahello commented Sep 18, 2021

"antd": "^4.16.13"


    const personalInfo = {
      name: { first: 'Nate', last: 'Wang' },
      email: '[email protected]',
      gender: 'Male',
      dateOfBirth: moment('2100-01-01'),
      phone: '15988888888',
      city: 'Shanghai',
      address: 'No.1000 Some Road, Zhangjiang Park, Pudong New District',
    }

    const meta = {
      columns: 2,
      fields: [
        { key: 'name.first', label: 'First Name' },
        { key: 'name.last', label: 'Last Name' },
        { key: 'gender', label: 'Gender' },
        {
          key: 'dateOfBirth',
          label: 'Date of Birth',
        },
        { key: 'email', label: 'Email' },
        { key: 'phone', label: 'Phone' },
        { key: 'address', label: 'Address', colSpan: 2 },
        { key: 'city', label: 'City' },
        { key: 'zipCode', label: 'Zip Code' },
      ],
    }

render () {

return (
 <Drawer
        visible={true}
        footer={
          <div style={{ textAlign: 'left' }}>
            <Button onClick={onClose} style={{ marginRight: 8 }}>
              Close
            </Button>
          </div>
        }
      >
        <div>
          <FormBuilder meta={meta} form={this.formRef} initialValues={personalInfo} viewMode />

        </div>

      </Drawer>
    );

  }

@VladimirVM
Copy link

<FormBuilder meta={meta} form={this.formRef} initialValues={personalInfo} viewMode />

remove attribute form

@berakoc
Copy link

berakoc commented Oct 18, 2023

I would highly recommend not using class components in React. Since they are nearly obsolete and hard to integrate with other libraries.

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

3 participants