From ef1f0f87e88c96f2f6a32e267b009995cd3c8e2b Mon Sep 17 00:00:00 2001 From: Brandon Hall Date: Mon, 6 Aug 2018 15:05:06 -0400 Subject: [PATCH] [react-virtualized] Fix WindowScrollerChildProps (#27880) --- .../dist/es/WindowScroller.d.ts | 16 +++------------- types/react-virtualized/index.d.ts | 1 + 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/types/react-virtualized/dist/es/WindowScroller.d.ts b/types/react-virtualized/dist/es/WindowScroller.d.ts index 628d58744d..c3074208d6 100644 --- a/types/react-virtualized/dist/es/WindowScroller.d.ts +++ b/types/react-virtualized/dist/es/WindowScroller.d.ts @@ -11,26 +11,16 @@ export type WindowScrollerChildProps = { width: number; isScrolling: boolean; scrollTop: number; - onChildScroll: () => void; + onChildScroll: (params: { scrollTop: number }) => void; }; export type WindowScrollerProps = { /** * Function responsible for rendering children. * This function should implement the following signature: - * ({ height, isScrolling, scrollLeft, scrollTop, width }) => PropTypes.element + * ({ height, isScrolling, scrollLeft, scrollTop, width, onChildScroll }) => PropTypes.element */ - children: ( - params: { - onChildScroll: (params: { scrollTop: number }) => void; - registerChild: (params?: Element) => void; - height: number; - isScrolling: boolean; - scrollLeft: number; - scrollTop: number; - width: number; - } - ) => React.ReactNode; + children: (params: WindowScrollerChildProps) => React.ReactNode; /** Callback to be invoked on-resize: ({ height, width }) */ onResize?: (params: { height: number; width: number }) => void; diff --git a/types/react-virtualized/index.d.ts b/types/react-virtualized/index.d.ts index b7c557d875..4cbc644bc8 100644 --- a/types/react-virtualized/index.d.ts +++ b/types/react-virtualized/index.d.ts @@ -7,6 +7,7 @@ // Kræn Hansen // Steve Zhang // Maciej Goszczycki +// Brandon Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8