Skip to content

Commit

Permalink
fix: update container props
Browse files Browse the repository at this point in the history
  • Loading branch information
adyfk committed Jun 21, 2023
1 parent 41ffc00 commit de4cd6f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/v2/components/FormGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function SchemaComponent({
schema={schema}
data={data}
key={`${parent}-${identity}-${indexContainer}-${indexValue}-${generatedKey}`}
{...containerProps}
containerProps={containerProps}
>
<FormGenerator
parent={`${identity}.${indexValue}`}
Expand Down Expand Up @@ -152,12 +152,13 @@ export function SchemaComponent({
wrapper={wrapper}
schema={schema}
>
{({ value, container: Container }, indexValue) => (
{({ value, container: Container, containerProps }, indexValue) => (
<Container
index={indexValue}
schema={schema}
data={value}
key={`${identity}`}
containerProps={containerProps}
>
<FormGenerator
parent={`${identity}`}
Expand Down
4 changes: 2 additions & 2 deletions src/v2/components/FormManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function SchemaComponent({
schema={schema}
data={{}}
index={indexValue}
{...containerProps}
containerProps={containerProps}
>
<FormManagement
parent={`${identity}.${generateId()}`}
Expand Down Expand Up @@ -145,7 +145,7 @@ export function SchemaComponent({
data={value}
index={indexValue}
key={`${identity}`}
{...containerProps}
containerProps={containerProps}
>
<FormManagement
parent={`${identity}`}
Expand Down
1 change: 1 addition & 0 deletions src/v2/contexts/ComponentContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type IComponentContainerProps<T = any> = {
children: any;
schema: T;
index: number;
containerProps?: Record<string, any>;
}

export type IComponentProps<T> = {
Expand Down

0 comments on commit de4cd6f

Please sign in to comment.