Use correct type for rc-tooltip's overlay (#18579)

The previous type signature doesn't allow e.g. strings to be passed in,
even though they're completely valid.
This commit is contained in:
Anton Strömkvist
2017-08-03 18:57:02 +02:00
committed by Sheetal Nandi
parent 6908279bc5
commit 567377968c
2 changed files with 9 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
// Type definitions for rc-tooltip v3.4.2
// Project: https://github.com/react-component/tooltip
// Definitions by: rhysd <https://rhysd.github.io>
// ahstro <http://ahst.ro>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -26,7 +27,7 @@ declare namespace Tooltip {
placement?: Placement | Object;
align?: Object;
onPopupAlign?: (popupDomNode: Element, align: Object) => void;
overlay: React.ReactElement<any> | (() => React.ReactElement<any>);
overlay: React.ReactNode;
arrowContent?: React.ReactNode;
getTooltipContainer?: () => Element;
destroyTooltipOnHide?: boolean;

View File

@@ -9,6 +9,13 @@ ReactDOM.render(
document.querySelector('.app')
);
ReactDOM.render(
<Tooltip overlay="tooltip">
<a href='#'>hover</a>
</Tooltip>,
document.querySelector('.app')
);
ReactDOM.render(
<Tooltip
placement="bottomRight"