@momentum-ui/react-collaboration
Version:
Cisco Momentum UI Framework for React Collaboration Applications
15 lines • 558 B
JavaScript
import { useEffect } from 'react';
/**
* Check if `aria-label` or `aria-labelledby` are defined and are truthy
*
* @param componentName The name of the component
* @param props The object of props passed to the component
*/
export function useCheckAriaLabel(componentName, props) {
useEffect(function () {
if (!props['aria-label'] && !props['aria-labelledby']) {
console.warn("MRV2: ".concat(componentName, " requires aria-label or aria-labelledby."));
}
}, [componentName, props]);
}
//# sourceMappingURL=a11y.js.map