Skip to content

Commit 35dbb82

Browse files
author
Kubit
committed
Improve useCrollEffect hook
Add CustomHookProps
1 parent be56b21 commit 35dbb82

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/hooks/useScrollEffect/useScrollEffect.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,21 @@ interface CustomHookReturnValue {
88
shadowRef: (node) => void;
99
}
1010

11+
interface CustomHookProps {
12+
shadowStyles?: string;
13+
conditional?: boolean;
14+
shadowVisible?: number;
15+
}
16+
1117
const MAX_PERCENTAGE = 100;
1218
const proportionLimit = 1.25;
1319
const defaultShadow = 'none';
1420

15-
export const useScrollEffect = (
21+
export const useScrollEffect = ({
1622
conditional = true,
1723
shadowStyles = defaultShadow,
18-
shadowVisible = 1
19-
): CustomHookReturnValue => {
24+
shadowVisible = 1,
25+
}: CustomHookProps): CustomHookReturnValue => {
2026
// the scrollable element ref
2127
const innerScrollableRef = useRef<HTMLElement | null>(null);
2228
// the element ref to change the height and width

0 commit comments

Comments
 (0)