import React from 'react'; import Tooltip from '../tooltip'; import getPlacements from './placements'; import warning from 'warning'; const placements = getPlacements(); export default class Popover extends React.Component { static defaultProps = { prefixCls: 'ant-popover', placement: 'top', transitionName: 'zoom-big', trigger: 'hover', mouseEnterDelay: 0.1, mouseLeaveDelay: 0.1, overlayStyle: {}, } render() { return ( {this.props.children} ); } getPopupDomNode() { return this.refs.tooltip.getPopupDomNode(); } componentDidMount() { if ('overlay' in this.props) { warning(false, '`overlay` prop of Popover is deprecated, use `content` instead.'); } } getOverlay() { // use content replace overlay // keep overlay for compatibility const { title, prefixCls, overlay, content } = this.props; return (
{title &&
{title}
}
{content || overlay}
); } }