UNPKG

antd

Version:

An enterprise-class UI design language and React components implementation

18 lines 422 B
import { isValidElement } from 'react'; import isNonNullable from './isNonNullable'; const convertToTooltipProps = (tooltip, context) => { if (!isNonNullable(tooltip)) { return null; } if (typeof tooltip === 'object' && ! /*#__PURE__*/isValidElement(tooltip)) { return { ...context, ...tooltip }; } return { ...context, title: tooltip }; }; export default convertToTooltipProps;