mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[reactstrap] Update Tooltip and Popover to add RefObject as a target (#41552)
* [reactstrap] Update Popover to add RefObject as a target * [reactstrap] Add to the test the usages of React.RefObject * [reactstrap] Update Tooltip, Popover, and Collapse to add RefObject as a target * [reactstrap] Remove RefObject from Collapse definition
This commit is contained in:
parent
be840b6e1d
commit
d247933faa
4
types/reactstrap/lib/Popover.d.ts
vendored
4
types/reactstrap/lib/Popover.d.ts
vendored
@ -6,8 +6,8 @@ export interface PopoverProps extends React.HTMLAttributes<HTMLElement> {
|
||||
[key: string]: any;
|
||||
isOpen?: boolean;
|
||||
toggle?: React.MouseEventHandler<any> | (() => void);
|
||||
target: string | HTMLElement;
|
||||
container?: string | HTMLElement;
|
||||
target: string | HTMLElement | React.RefObject<HTMLElement>;
|
||||
container?: string | HTMLElement | React.RefObject<HTMLElement>;
|
||||
boundariesElement?: Popper.Boundary | Element;
|
||||
className?: string;
|
||||
placement?: Popper.Placement;
|
||||
|
||||
4
types/reactstrap/lib/Tooltip.d.ts
vendored
4
types/reactstrap/lib/Tooltip.d.ts
vendored
@ -4,8 +4,8 @@ import { CSSModule } from '../index';
|
||||
|
||||
export interface UncontrolledTooltipProps extends React.HTMLAttributes<HTMLElement> {
|
||||
[key: string]: any;
|
||||
target: string | HTMLElement;
|
||||
container?: string | HTMLElement;
|
||||
target: string | HTMLElement | React.RefObject<HTMLElement>;
|
||||
container?: string | HTMLElement | React.RefObject<HTMLElement>;
|
||||
delay?: number | {show: number, hide: number};
|
||||
className?: string;
|
||||
popperClassName?: string;
|
||||
|
||||
@ -4776,3 +4776,20 @@ class Example130 extends React.Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const CustomInputTestInnerRef = () => {
|
||||
const ref = React.createRef<HTMLButtonElement>();
|
||||
return (<CustomInput type="checkbox" innerRef={ref} />);
|
||||
};
|
||||
|
||||
const PopoverTestInnerRef = () => {
|
||||
const target = React.createRef<HTMLButtonElement>();
|
||||
const container = React.createRef<HTMLDivElement>();
|
||||
return (<Popover target={target} container={container}>Yo!</Popover>);
|
||||
};
|
||||
|
||||
const UncontrolledTooltipTestInnerRef = () => {
|
||||
const target = React.createRef<HTMLButtonElement>();
|
||||
const container = React.createRef<HTMLDivElement>();
|
||||
return (<UncontrolledTooltip target={target} container={container}>Yo!</UncontrolledTooltip>);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user