mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-04 19:42:46 +08:00
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:
committed by
Sheetal Nandi
parent
6908279bc5
commit
567377968c
3
types/rc-tooltip/index.d.ts
vendored
3
types/rc-tooltip/index.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user