mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added definitions required to override getParentElement (#29317)
This commit is contained in:
parent
29d283ca5c
commit
bfa300406a
5
types/react-infinite-scroller/index.d.ts
vendored
5
types/react-infinite-scroller/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/CassetteRocks/react-infinite-scroller
|
||||
// Definitions by: Lauri Lavanti <https://github.com/Lapanti>,
|
||||
// Piotr Srebniak <https://github.com/psrebniak>
|
||||
// Brett Miller <https://github.com/WrathZA>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@ -62,7 +63,9 @@ declare namespace InfiniteScroll {
|
||||
*/
|
||||
loader?: React.ReactElement<any>;
|
||||
}
|
||||
class InfiniteScroll extends React.Component<InfiniteScrollProps> { }
|
||||
class InfiniteScroll extends React.Component<InfiniteScrollProps> {
|
||||
getParentElement(elem?: HTMLElement | null): HTMLElement | undefined | null;
|
||||
}
|
||||
namespace InfiniteScroll {}
|
||||
}
|
||||
|
||||
|
||||
@ -32,3 +32,16 @@ class Test2 extends React.Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class InfiniteScrollOverride extends InfiniteScroll {
|
||||
getParentElement(el: HTMLElement) {
|
||||
if (document.getElementById("scroll-header")) {
|
||||
return document.getElementById("scroll-header");
|
||||
}
|
||||
return super.getParentElement(el);
|
||||
}
|
||||
|
||||
render() {
|
||||
return super.render();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user