convertToTooltipProps.js 342 B

1234567891011121314
  1. import { isValidElement } from 'react';
  2. function convertToTooltipProps(tooltip) {
  3. // isNil
  4. if (tooltip === undefined || tooltip === null) {
  5. return null;
  6. }
  7. if (typeof tooltip === 'object' && ! /*#__PURE__*/isValidElement(tooltip)) {
  8. return tooltip;
  9. }
  10. return {
  11. title: tooltip
  12. };
  13. }
  14. export default convertToTooltipProps;