diff --git a/packages/react/src/components/UIShell/SideNavDetails.js b/packages/react/src/components/UIShell/SideNavDetails.js index 3273f408ed39..b300f82cbed1 100644 --- a/packages/react/src/components/UIShell/SideNavDetails.js +++ b/packages/react/src/components/UIShell/SideNavDetails.js @@ -11,19 +11,14 @@ import PropTypes from 'prop-types'; import React from 'react'; import { warning } from '../../internal/warning'; -let didWarnAboutDeprecation = false; - const { prefix } = settings; const SideNavDetails = ({ children, className: customClassName, title }) => { - if (__DEV__) { - warning( - didWarnAboutDeprecation, - 'The `SideNavDetails` component has been deprecated and will be removed ' + - 'in the next major release of `carbon-components-react`' - ); - didWarnAboutDeprecation = true; - } + warning( + true, + 'The `SideNavDetails` component has been deprecated and will be removed ' + + 'in the next major release of `carbon-components-react`' + ); const className = cx(`${prefix}--side-nav__details`, customClassName); return ( diff --git a/packages/react/src/components/UIShell/SideNavFooter.js b/packages/react/src/components/UIShell/SideNavFooter.js index 1d529474e83b..9aba48760c05 100644 --- a/packages/react/src/components/UIShell/SideNavFooter.js +++ b/packages/react/src/components/UIShell/SideNavFooter.js @@ -13,8 +13,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import { warning } from '../../internal/warning'; -let didWarnAboutDeprecation = false; - const { prefix } = settings; /** @@ -28,14 +26,11 @@ const SideNavFooter = ({ expanded, onToggle, }) => { - if (__DEV__) { - warning( - didWarnAboutDeprecation, - 'The `SideNavFooter` component has been deprecated and will be removed ' + - 'in the next major release of `carbon-components-react`' - ); - didWarnAboutDeprecation = true; - } + warning( + true, + 'The `SideNavFooter` component has been deprecated and will be removed ' + + 'in the next major release of `carbon-components-react`' + ); const className = cx(`${prefix}--side-nav__footer`, customClassName); return ( diff --git a/packages/react/src/components/UIShell/SideNavHeader.js b/packages/react/src/components/UIShell/SideNavHeader.js index ed32cf06df1e..ed8ef10901d0 100644 --- a/packages/react/src/components/UIShell/SideNavHeader.js +++ b/packages/react/src/components/UIShell/SideNavHeader.js @@ -12,8 +12,6 @@ import React from 'react'; import SideNavIcon from './SideNavIcon'; import { warning } from '../../internal/warning'; -let didWarnAboutDeprecation = false; - const { prefix } = settings; const SideNavHeader = ({ @@ -21,14 +19,11 @@ const SideNavHeader = ({ children, renderIcon: IconElement, }) => { - if (__DEV__) { - warning( - didWarnAboutDeprecation, - 'The `SideNavHeader` component has been deprecated and will be removed ' + - 'in the next major release of `carbon-components-react`' - ); - didWarnAboutDeprecation = true; - } + warning( + true, + 'The `SideNavHeader` component has been deprecated and will be removed ' + + 'in the next major release of `carbon-components-react`' + ); const className = cx(`${prefix}--side-nav__header`, customClassName); return ( diff --git a/packages/react/src/components/UIShell/SideNavSwitcher.js b/packages/react/src/components/UIShell/SideNavSwitcher.js index 5930ae3f3fea..174b534d3176 100644 --- a/packages/react/src/components/UIShell/SideNavSwitcher.js +++ b/packages/react/src/components/UIShell/SideNavSwitcher.js @@ -13,19 +13,14 @@ import React from 'react'; import { warning } from '../../internal/warning'; -let didWarnAboutDeprecation = false; - const { prefix } = settings; const SideNavSwitcher = React.forwardRef(function SideNavSwitcher(props, ref) { - if (__DEV__) { - warning( - didWarnAboutDeprecation, - 'The `SideNavSwitcher` component has been deprecated and will be removed ' + - 'in the next major release of `carbon-components-react`' - ); - didWarnAboutDeprecation = true; - } + warning( + true, + 'The `SideNavSwitcher` component has been deprecated and will be removed ' + + 'in the next major release of `carbon-components-react`' + ); const { className: customClassName, labelText, onChange, options } = props; const className = cx(`${prefix}--side-nav__switcher`, customClassName);