Skip to content

Commit e91ef7e

Browse files
committed
chore: type error in plugin-backtop
1 parent 200708b commit e91ef7e

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

packages/plugin-backtop/src/component/index.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ const isObject = (val: unknown): val is DefaultTheme.BackTopOptions =>
88

99
export function BackTop({
1010
backTop
11-
}: { backTop?: DefaultTheme.BackTopOptions } & ComponentPropsWithIsland) {
12-
const backTopCtrl = isObject(backTop) ? true : backTop ?? true;
11+
}: {
12+
backTop?: DefaultTheme.BackTopOptions | boolean;
13+
} & ComponentPropsWithIsland) {
14+
const backTopEnabled = isObject(backTop) ? true : backTop ?? true;
1315

1416
let visibleHeight = 200;
1517
let duration = 500;
@@ -55,7 +57,7 @@ export function BackTop({
5557
};
5658
});
5759

58-
return backTopCtrl && visible ? (
60+
return backTopEnabled && visible ? (
5961
<div
6062
className="fixed bottom-10 right-30 z-10"
6163
display="none md:block"

packages/plugin-backtop/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"compilerOptions": {
44
"rootDir": ".",
55
"baseUrl": "src",
6-
}
6+
},
7+
"include": ["src"],
78
}

0 commit comments

Comments
 (0)