Skip to content
Snippets Groups Projects
Unverified Commit 70772211 authored by Uladzimir Havenchyk's avatar Uladzimir Havenchyk Committed by GitHub
Browse files

Lazy load EntityForm (#33978)

* Lazy load EntityForm

* Replace lazy loading with require

* add a comment
parent 109a5a87
No related branches found
No related tags found
No related merge requests found
......@@ -2,9 +2,7 @@
import { Component } from "react";
import { t } from "ttag";
import Form from "metabase/containers/FormikForm";
import ModalContent from "metabase/components/ModalContent";
import entityType from "./EntityType";
export function getForm(entityDef) {
......@@ -24,12 +22,14 @@ const EForm = ({
resumedValues,
...props
}) => {
// custom lazy loading to prevent circular deps problem
const FormikForm = require("metabase/containers/FormikForm").default;
const initialValues =
typeof entityObject?.getPlainObject === "function"
? entityObject.getPlainObject()
: entityObject;
return (
<Form
<FormikForm
{...props}
form={form}
initialValues={{ ...initialValues, ...resumedValues }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment