Skip to content

Commit 2d04986

Browse files
committed
chore: code optimization
1 parent f07e0d6 commit 2d04986

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/PortalWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function getOpenCount() {
1717

1818
// https://github.com/ant-design/ant-design/issues/19340
1919
// https://github.com/ant-design/ant-design/issues/19332
20-
let cacheOverflow = {};
20+
let cacheOverflow: React.CSSProperties = {};
2121

2222
const getParent = (getContainer: GetContainer) => {
2323
if (!supportDom) {

src/getScrollBarSize.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ ${heightStyle}
6868

6969
// Measure. Get fallback style if provided
7070
const scrollWidth =
71-
ele && fallbackWidth && !isNaN(fallbackWidth)
71+
ele && fallbackWidth && !Number.isNaN(fallbackWidth)
7272
? fallbackWidth
7373
: measureEle.offsetWidth - measureEle.clientWidth;
74+
7475
const scrollHeight =
75-
ele && fallbackHeight && !isNaN(fallbackHeight)
76+
ele && fallbackHeight && !Number.isNaN(fallbackHeight)
7677
? fallbackHeight
7778
: measureEle.offsetHeight - measureEle.clientHeight;
7879

src/isMobile.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import isMobile from 'is-mobile';
22

33
let cached: boolean;
44

5-
export default () => {
5+
const getIsMobile = () => {
66
if (typeof cached === 'undefined') {
77
cached = isMobile();
88
}
9-
109
return cached;
1110
};
11+
12+
export default getIsMobile;

0 commit comments

Comments
 (0)