Skip to content

Commit

Permalink
fix: wrap buildForm Field components in <Suspense>
Browse files Browse the repository at this point in the history
  • Loading branch information
ribeirojose committed Jun 16, 2024
1 parent 69077c8 commit f6c1044
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/components/FormBuilder/buildForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { Suspense } from "react";

import { evaluateConditions } from "./evaluateConditions";
import { BaseField, CommonFieldProps, FieldComponentType } from "./types";
Expand Down Expand Up @@ -35,12 +35,14 @@ export function buildForm(
const name = field.name.replace("RESOURCE_ID", String(index));

return (
<FieldComponent
key={field.name + name + index}
field={{ ...field, name, index }}
form={form}
customComponents={customComponents}
/>
<Suspense>
<FieldComponent
key={field.name + name + index}
field={{ ...field, name, index }}
form={form}
customComponents={customComponents}
/>
</Suspense>
);
});

Expand Down

0 comments on commit f6c1044

Please sign in to comment.