Skip to content

Commit e086013

Browse files
Fix rest props passing for link list (#1430)
Fix prop passing for the `LinkList` component --------- Co-authored-by: Copilot <[email protected]>
1 parent b971ad6 commit e086013

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.changeset/public-showers-read.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@obosbbl/grunnmuren-react": patch
3+
---
4+
5+
Passes rest props to the root element of the component, not the `<ul>` tag. If you are passing other HTML props than `className` to the `<LinkList>` this will be a breaking change.

packages/react/src/link-list/link-list.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ import { cx } from 'cva';
77
import { Children, type JSX, type ReactNode } from 'react';
88
import { Link, type LinkProps } from 'react-aria-components';
99

10-
type LinkListProps = React.HTMLProps<HTMLUListElement> & {
10+
type LinkListProps = React.HTMLProps<HTMLDivElement> & {
1111
children: JSX.Element | JSX.Element[];
1212
};
1313

1414
const LinkList = ({ className, children, ...restProps }: LinkListProps) => {
1515
const numberofLinks = Children.count(children);
1616
return (
17-
<div className={cx(className, '@container')}>
17+
<div className={cx(className, '@container')} {...restProps}>
1818
<ul
19-
{...restProps}
2019
className={cx(
2120
'min-w-fit',
2221
// Hide dividers at the top of the list (overflow-y) and prevents arrow icon from overflowing container when animated to the right (overflow-x)

0 commit comments

Comments
 (0)