Skip to content

Commit 4f53493

Browse files
committed
Make labelProps optional
1 parent 162e0de commit 4f53493

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/components/warning-callout/WarningCallout.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { HTMLProps } from 'react';
22
import classNames from 'classnames';
33

44
interface WarningCalloutProps extends HTMLProps<HTMLDivElement> {
5-
labelProps: HTMLProps<HTMLHeadingElement>;
5+
labelProps?: HTMLProps<HTMLHeadingElement>;
66
}
77

88
const WarningCallout: React.FC<WarningCalloutProps> = ({
@@ -15,7 +15,7 @@ const WarningCallout: React.FC<WarningCalloutProps> = ({
1515
<div className={classNames('nhsuk-warning-callout', className)} {...rest}>
1616
{label ? (
1717
<h3
18-
className={classNames('nhsuk-warning-callout__label', labelProps.className)}
18+
className={classNames('nhsuk-warning-callout__label', labelProps?.className)}
1919
{...labelProps}
2020
>
2121
{label}
@@ -25,8 +25,4 @@ const WarningCallout: React.FC<WarningCalloutProps> = ({
2525
</div>
2626
);
2727

28-
WarningCallout.defaultProps = {
29-
labelProps: {},
30-
};
31-
3228
export default WarningCallout;

0 commit comments

Comments
 (0)