Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix: allow components to pass properties (#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
tilmx authored and marionebl committed Jan 31, 2019
1 parent 2573b07 commit a8223b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/preview-renderer/preview-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export class PreviewComponent extends React.Component<PreviewComponentProps> {

public render(): JSX.Element | null {
const props = this.props as Injected;
const { store, element, ...other } = this.props as Injected;

const children = props.store.getChildren(props.element, child => (
<PreviewComponent key={child.getId()} element={child} />
Expand All @@ -121,8 +122,8 @@ export class PreviewComponent extends React.Component<PreviewComponentProps> {
}

return (
<PreviewComponentError name={props.element.getName()}>
<Component {...properties} {...slots}>
<PreviewComponentError name={props.element.getName()} {...other}>
<Component {...properties} {...other} {...slots}>
{children}
</Component>
</PreviewComponentError>
Expand Down

1 comment on commit a8223b7

@marionebl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.