react icon indicating copy to clipboard operation
react copied to clipboard

Extending a SubmissionGrid component I get error [Uncaught TypeError: Cannot call a class as a function]

Open sdancer75 opened this issue 3 years ago • 2 comments

Using the latest version of @react/formio v5.2.3 I get

Uncaught TypeError: Cannot call a class as a function when I am trying to extend the parent component ie

export default class CustomSubmissionGrid extends SubmissionGrid {}

The error occurred from @babel/runtime/helpers/esm/classCallCheck.js:3:1 at the following code

  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}

Any recommendation to solve this?

sdancer75 avatar Jul 06 '22 08:07 sdancer75

In @formio/[email protected], SubmissionGrid is a functional component and cannot be extended.

TanyaGashtold avatar May 11 '23 13:05 TanyaGashtold

Yes thank you, I discovered this change. So the main question here is how to change (extend) the behavior of the component? Is there a viable solution to override somehow?

sdancer75 avatar May 13 '23 05:05 sdancer75