Skip to content

Commit

Permalink
feat: support restProps for React ColumnLayout component
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert authored and Yolijn committed Oct 12, 2024
1 parent c705163 commit b520118
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-plums-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/component-library-react": minor
---

Support `restProps` for React `ColumnLayout` component.
11 changes: 9 additions & 2 deletions packages/component-library-react/src/ColumnLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@ export interface ColumnLayoutProps extends HTMLAttributes<HTMLDivElement> {
}

export const ColumnLayout = forwardRef(
({ children, className, rule }: PropsWithChildren<ColumnLayoutProps>, ref: ForwardedRef<HTMLDivElement>) => (
<div className={clsx('utrecht-column-layout', { 'utrecht-column-layout--rule': rule }, className)} ref={ref}>
(
{ children, className, rule, ...restProps }: PropsWithChildren<ColumnLayoutProps>,
ref: ForwardedRef<HTMLDivElement>,
) => (
<div
className={clsx('utrecht-column-layout', { 'utrecht-column-layout--rule': rule }, className)}
ref={ref}
{...restProps}
>
{children}
</div>
),
Expand Down

0 comments on commit b520118

Please sign in to comment.