@equinor/eds-utils
Version:
Utility functions and hooks for the Equinor Design System
20 lines (19 loc) • 632 B
TypeScript
/**
* Hook that displays a deprecation warning in the console during development.
* The warning is only shown once per component instance and only in development mode.
*
* @param message - The deprecation warning message to display
* @param componentName - Optional component name to prefix the warning
*
* @example
* ```tsx
* function MyDeprecatedComponent() {
* useDeprecationWarning(
* 'MyComponent is deprecated. Use NewComponent instead.',
* 'MyComponent'
* )
* return <div>Content</div>
* }
* ```
*/
export declare const useDeprecationWarning: (message: string, componentName?: string) => void;