diff --git a/src/components/page/page_header/page_header.tsx b/src/components/page/page_header/page_header.tsx index 52624c4d6d..50cf06ac87 100644 --- a/src/components/page/page_header/page_header.tsx +++ b/src/components/page/page_header/page_header.tsx @@ -28,7 +28,7 @@ * under the License. */ -import React, { FunctionComponent, HTMLAttributes } from 'react'; +import React, { FunctionComponent, HTMLAttributes, useEffect } from 'react'; import classNames from 'classnames'; import { CommonProps, keysOf } from '../../common'; import { @@ -92,6 +92,14 @@ export const OuiPageHeader: FunctionComponent = ({ style ); + useEffect(() => { + if (iconType || iconProps) { + console.warn( + 'WARNING: The `iconType` and `iconProps` properties in `OuiPageHeader` are deprecated and will be removed in the future. Please update your code accordingly.' + ); + } + }, [iconType, iconProps]); + const classes = classNames( 'ouiPageHeader', paddingSizeToClassNameMap[paddingSize], diff --git a/src/components/page/page_header/page_header_content.tsx b/src/components/page/page_header/page_header_content.tsx index 6fbcb905bd..8677778fdd 100644 --- a/src/components/page/page_header/page_header_content.tsx +++ b/src/components/page/page_header/page_header_content.tsx @@ -58,10 +58,12 @@ export type OuiPageHeaderContentTitle = { pageTitle?: ReactNode; /** * Optional icon to place to the left of the title + * @deprecated The `iconType` prop is deprecated and will be removed in the future. */ iconType?: IconType; /** * Additional OuiIcon props to apply to the optional icon + * @deprecated The `iconProps` prop is deprecated and will be removed in the future. */ iconProps?: Partial>; };