Skip to content

Commit c9625d8

Browse files
authoredApr 12, 2022
type(@uiw/react-back-top):修复类型问题 (#762)
1 parent a62e924 commit c9625d8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎packages/react-back-top/src/index.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import { IProps, HTMLDivProps } from '@uiw/utils';
33
import { getScrollPercent, getScrollTop, scrollToAnimate } from './utils';
44
import './style/index.less';
55

6-
export interface BackTopProps extends IProps, HTMLDivProps {
6+
export interface ChildrenFunction {
7+
scrollToTop: () => void;
8+
percent: number;
9+
current: number;
10+
}
11+
12+
export interface BackTopProps extends IProps, Omit<HTMLDivProps, 'children'> {
713
offsetTop?: number;
814
clickable?: boolean;
915
content?: JSX.Element | string;
@@ -13,6 +19,7 @@ export interface BackTopProps extends IProps, HTMLDivProps {
1319
*/
1420
showBelow?: number;
1521
speed?: number;
22+
children?: React.ReactNode | ((props: ChildrenFunction) => React.ReactNode);
1623
}
1724

1825
export interface IBackTopState {

0 commit comments

Comments
 (0)
Please sign in to comment.