UNPKG

react-tray

Version:

An accessible tray component useful for navigation menus

13 lines (11 loc) 613 B
// Adapted from https://github.com/react-bootstrap/react-prop-types/blob/master/src/isRequiredForA11y.js 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports.a11yFunction = a11yFunction; function a11yFunction(props, propName, componentName) { if (!props[propName] || typeof props[propName] !== 'function') { return new Error('The prop \'' + propName + '\' is required to make \'' + componentName + '\' fully accessible. ' + 'This will greatly improve the experience for users of assistive technologies. ' + 'You should provide a function that returns a DOM node.'); } }