Skip to content

Commit

Permalink
fix: "unrecognised props" ssr warnings (#2382)
Browse files Browse the repository at this point in the history
  • Loading branch information
anucreative authored Dec 27, 2023
1 parent cc1ae16 commit 1257b1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions packages/Accordion/src/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export const Accordion = styled.div`
}
`

export const Icon = styled(Box)<{ isOpen: Ariakit.DisclosureStoreState['open'] }>(
export const Icon = styled(Box).withConfig({
shouldForwardProp: prop => !['isOpen'].includes(prop),
})<{ isOpen: Ariakit.DisclosureStoreState['open'] }>(
({ isOpen }) => css`
flex-shrink: 0;
${th('accordions.icon')};
Expand Down Expand Up @@ -59,7 +61,9 @@ export const Disclosure = styled(Ariakit.Disclosure)`
}
`

export const Content = styled(Ariakit.DisclosureContent)(
export const Content = styled(Ariakit.DisclosureContent).withConfig({
shouldForwardProp: prop => !['isOpen'].includes(prop),
})(
({ isOpen }: { isOpen: UseAccordionState['open'] }) => css`
${th('accordions.content')};
padding-inline: ${th('accordions.padding')};
Expand Down
4 changes: 3 additions & 1 deletion packages/Tag/src/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export interface StyledTagProps {
variant: Variant
}

export const Tag = styled.div<StyledTagProps & WuiProps>(
export const Tag = styled.div.withConfig({
shouldForwardProp: prop => !['hasClickAction', 'hasLink', 'hasRemoveAction'].includes(prop),
})<StyledTagProps & WuiProps>(
({ h, hasClickAction, hasLink, hasRemoveAction, length, size, variant, w }) => css`
${th('tags.default')};
${th(`tags.variants.${variant}`)};
Expand Down

0 comments on commit 1257b1a

Please sign in to comment.