@carbon/react
Version:
React components for the Carbon Design System
27 lines (25 loc) • 914 B
JavaScript
/**
* Copyright IBM Corp. 2016, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const require_warning = require("../internal/warning.js");
//#region src/prop-types/deprecateComponent.ts
/**
* Copyright IBM Corp. 2016, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const didWarnAboutDeprecation = {};
const deprecateComponent = (componentName, message) => {
if (!componentName) return;
if (!didWarnAboutDeprecation[componentName]) {
didWarnAboutDeprecation[componentName] = true;
require_warning.warning(false, message || `The ${componentName} component has been deprecated and will be removed in the next major release.`);
}
return componentName;
};
//#endregion
exports.deprecateComponent = deprecateComponent;