diff --git a/packages/ffe-cards-react/src/CardBase.tsx b/packages/ffe-cards-react/src/CardBase.tsx index 0d6a2b0a29..671948dec8 100644 --- a/packages/ffe-cards-react/src/CardBase.tsx +++ b/packages/ffe-cards-react/src/CardBase.tsx @@ -36,10 +36,6 @@ function CardBaseWithForwardRef( ...rest } = props; - const withCardActionProps: React.ComponentProps = { - ...rest, - }; - return ( ( 'ffe-card-base--text-center': textCenter, 'ffe-card-base--no-padding': noPadding, })} - {...withCardActionProps} + {...(rest as Record)} ref={ref} > {({ CardAction }) => diff --git a/packages/ffe-cards-react/src/IconCard/IconCard.tsx b/packages/ffe-cards-react/src/IconCard/IconCard.tsx index c748ec402f..b9d07af714 100644 --- a/packages/ffe-cards-react/src/IconCard/IconCard.tsx +++ b/packages/ffe-cards-react/src/IconCard/IconCard.tsx @@ -22,9 +22,6 @@ function IconCardWithForwardRef( ref: ForwardedRef, ) { const { className, condensed, icon, children, ...rest } = props; - const withCardActionProps: React.ComponentProps = { - ...rest, - }; return ( ( { 'ffe-icon-card--condensed': condensed }, className, )} - {...withCardActionProps} + {...(rest as Record)} ref={ref} > {({ CardAction }) => ( diff --git a/packages/ffe-cards-react/src/ImageCard/ImageCard.tsx b/packages/ffe-cards-react/src/ImageCard/ImageCard.tsx index 4ced30a300..740d784364 100644 --- a/packages/ffe-cards-react/src/ImageCard/ImageCard.tsx +++ b/packages/ffe-cards-react/src/ImageCard/ImageCard.tsx @@ -22,13 +22,11 @@ function ImageCardWithForwardRef( ref: ForwardedRef, ) { const { className, imageSrc, imageAltText, children, ...rest } = props; - const withCardActionProps: React.ComponentProps = { - ...rest, - }; + return ( )} ref={ref} > {({ CardAction }) => ( diff --git a/packages/ffe-cards-react/src/StippledCard/StippledCard.tsx b/packages/ffe-cards-react/src/StippledCard/StippledCard.tsx index d8bb23e99c..b560bdb397 100644 --- a/packages/ffe-cards-react/src/StippledCard/StippledCard.tsx +++ b/packages/ffe-cards-react/src/StippledCard/StippledCard.tsx @@ -25,9 +25,7 @@ function StippledCardWithForwardRef( ref: ForwardedRef, ) { const { className, condensed, img, children, ...rest } = props; - const withCardActionProps: React.ComponentProps = { - ...rest, - }; + return ( ( { 'ffe-stippled-card--condensed': condensed }, className, )} - {...withCardActionProps} + {...(rest as Record)} ref={ref} > {({ CardAction }) => ( diff --git a/packages/ffe-cards-react/src/TextCard/TextCard.tsx b/packages/ffe-cards-react/src/TextCard/TextCard.tsx index 3eb9c1c042..b089f1dd37 100644 --- a/packages/ffe-cards-react/src/TextCard/TextCard.tsx +++ b/packages/ffe-cards-react/src/TextCard/TextCard.tsx @@ -10,7 +10,7 @@ export type TextCardProps = Omit< > & { /** Left-aligned text on the card */ leftAlign?: boolean; - /** Function that's passed available sub-components as arguments, or regular children */ + /** Function that's passed available subcomponents as arguments, or regular children */ children: | React.ReactNode | ((cardRenderProps: CardRenderProps) => React.ReactNode); @@ -22,10 +22,6 @@ function TextCardWithForwardRef( ) { const { className, leftAlign, children, ...rest } = props; - const withCardActionProps: React.ComponentProps = { - ...rest, - }; - return ( ( { 'ffe-text-card--left-align': leftAlign }, className, )} - {...withCardActionProps} + {...(rest as Record)} ref={ref} > {({ CardAction }) => diff --git a/packages/ffe-form-react/src/InputGroup.tsx b/packages/ffe-form-react/src/InputGroup.tsx index 8f1c5908f1..2e713b3b2b 100644 --- a/packages/ffe-form-react/src/InputGroup.tsx +++ b/packages/ffe-form-react/src/InputGroup.tsx @@ -27,7 +27,7 @@ export interface InputGroupProps */ extraMargin?: boolean; /** Use the ErrorFieldMessage component if you need more flexibility in how the content is rendered. */ - fieldMessage?: string | React.ReactElement<{ id: string }>; + fieldMessage?: string | React.ReactElement<{ id: string }> | null; /** To just render a static, always visible tooltip, use this. */ description?: string; /** Use the Label component if you need more flexibility in how the content is rendered. */