Skip to content

Commit

Permalink
Fix generic
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Jan 3, 2025
1 parent de34200 commit 586334a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/src/components/tag/TagList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ const tagListCSS = css`
gap: var(--ac-global-dimension-size-50);
height: 28px;
`;
function TagList<T extends Record<string, unknown>>(
function TagList<T extends object>(
props: TagListProps<T>,
ref: Ref<HTMLDivElement>
) {
return <AriaTagList {...props} ref={ref} css={tagListCSS} />;
}

const _TagList = forwardRef(TagList);
// Use forwardRef with the generic type to ensure the type propagates
const _TagList = forwardRef(TagList) as <T extends object>(
props: TagListProps<T> & { ref?: Ref<HTMLDivElement> }
) => JSX.Element;

export { _TagList as TagList };
export type { TagListProps };

0 comments on commit 586334a

Please sign in to comment.