Skip to content

Commit 56790d7

Browse files
committed
Fix typescript typing of component
1 parent 0bfa5fb commit 56790d7

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/component/index.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,15 @@ export interface Props {
2929
* If children passed is a function, that function will be passed a React.RefObject<HTMLElement>
3030
* that ref shall be passed to a child tag that will be used for the scrolling container.
3131
* */
32-
children?: React.ReactNode | (<T extends HTMLElement>(ref: React.Ref<T>) => React.ReactNode)
32+
children?:
33+
| JSX.Element
34+
| (<T>(ref: ((instance: T | null) => void) | React.MutableRefObject<T | null> | null) => JSX.Element)
3335
}
3436

3537
/**
3638
* A simple React component that lets you listen for when you have scrolled to the bottom.
3739
*/
38-
const BottomScrollListener = ({
39-
children,
40-
onBottom,
41-
offset,
42-
debounce,
43-
debounceOptions,
44-
}: Props): React.ReactNode | null => {
40+
const BottomScrollListener = ({ children, onBottom, offset, debounce, debounceOptions }: Props): JSX.Element | null => {
4541
const optionalScrollContainerRef = useBottomScrollListener(onBottom, offset, debounce, debounceOptions)
4642

4743
if (!children) return null

0 commit comments

Comments
 (0)