Skip to content

Commit ba4be70

Browse files
committed
fix: pass props to child component
1 parent e860dec commit ba4be70

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/Container.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import React, { ComponentType, ReactElement } from 'react';
1313
import { Utils } from '../utils/Utils';
1414
import { Properties, ClassNames } from '../constants';
15-
import { ModelProps } from '../types/AEMModel';
15+
import { ModelProps, PageModel } from '../types/AEMModel';
1616
import { ComponentMapping, MapTo } from '../core/ComponentMapping';
1717
import { Config, MappedComponentProperties } from '../types/EditConfig';
1818

@@ -28,6 +28,7 @@ export type ContainerProps = {
2828
removeDefaultStyles?: boolean;
2929
config?: Config<MappedComponentProperties>;
3030
components?: { [key: string]: ComponentType<MappedComponentProperties> };
31+
model?: PageModel;
3132
} & ModelProps;
3233

3334
const getItemPath = (cqPath: string, itemKey: string, isPage = false): string => {
@@ -81,6 +82,7 @@ export const Container = (props: ContainerProps): JSX.Element => {
8182
childPages,
8283
placeholderClassNames = '',
8384
components,
85+
model = {},
8486
} = props;
8587

8688
if (components && Object.keys(components).length) {
@@ -95,7 +97,7 @@ export const Container = (props: ContainerProps): JSX.Element => {
9597
}) ||
9698
{};
9799

98-
const childComponents = <ComponentList {...props} />;
100+
const childComponents = <ComponentList {...model} {...props} />;
99101

100102
return isInEditor ? (
101103
<div className={className || ClassNames.CONTAINER} {...containerProps}>

0 commit comments

Comments
 (0)