Issue with Atlaskit Form Component After Upgrade to Version 7.0.0

Hi Everyone,

I’ve recently upgraded the Form component in my React application from version 6.3.2 to 7.0.0(or later version). Since the upgrade, I’ve encountered the following error:

TypeError: Cannot read properties of null (reading 'formRef')

Here’s a simplified version of my component:

import React, { Fragment } from "react";
import Form from "@atlaskit/form";

export default class CommonDetailsTab extends React.Component {
  constructor(props) {
    super(props);
    this.formRef = React.createRef();
  }

  componentDidMount() {
    // Attempt to access formRef
    console.log(this.formRef.current);
    if (this.formRef.current) {
      this.formRef.current.submit();
    }
  }

  render = () => {
    return
      <div>
        <Form onSubmit={this.getData} ref={this.formRef}>
          {({ formProps }) => (
            <form {...formProps}>
              <div>
                {/* Render normal fields */}
              </div>
            </form>
          )}
        </Form>
      </div>
  };
}

I’m using a ref (this.formRef) to reference the form, and it was working perfectly fine in version 6.3.2. However, after upgrading, it seems that formRef is not being set properly, leading to the above error when attempting to access formRef.

Has anyone else encountered this issue? Is there a change in the way refs are handled in the new version of Atlaskit Form? Any help or guidance would be greatly appreciated.

Thank you!