Skip to content

Commit

Permalink
fix: extended component without ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Renato Pozzi committed May 25, 2022
1 parent 72b6db9 commit c0453c1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libs/plock/src/Masonry/Masonry.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
interface MasonryProps {
interface MasonryProps extends React.ComponentPropsWithoutRef<'div'> {
columns: number;
gap: string;
children: React.ReactNode;
}

const Masonry = ({ children, columns, gap }: MasonryProps) => {
const Masonry = ({ children, columns, gap, ...props }: MasonryProps) => {
return (
<div
style={{
Expand All @@ -13,25 +13,27 @@ const Masonry = ({ children, columns, gap }: MasonryProps) => {
columnGap: gap,
alignItems: 'start',
}}
{...props}
>
{children}
</div>
);
};

interface MasonryColumnProps {
interface MasonryColumnProps extends React.ComponentPropsWithoutRef<'div'> {
gap: string;
children: React.ReactNode;
}

const MasonryColumn = ({ children, gap }: MasonryColumnProps) => {
const MasonryColumn = ({ children, gap, ...props }: MasonryColumnProps) => {
return (
<div
style={{
display: 'grid',
gridTemplateColumns: '100%',
rowGap: gap,
}}
{...props}
>
{children}
</div>
Expand Down

0 comments on commit c0453c1

Please sign in to comment.