diff --git a/src/renderer/components/scroll-spy/scroll-spy.tsx b/src/renderer/components/scroll-spy/scroll-spy.tsx
index e9ab51acc0..9b57368d30 100644
--- a/src/renderer/components/scroll-spy/scroll-spy.tsx
+++ b/src/renderer/components/scroll-spy/scroll-spy.tsx
@@ -7,6 +7,12 @@ interface Props extends React.DOMAttributes {
rootMargin?: string // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#creating_an_intersection_observer
}
+ScrollSpy.defaultProps = {
+ // Shrinking root area from the bottom
+ // Allows to fire observer event only if target scrolled up to top of the page)
+ rootMargin: "0px 0px -85%"
+};
+
export function ScrollSpy(props: Props) {
const parent = useRef();
const sections = useRef>();
@@ -93,8 +99,3 @@ export function ScrollSpy(props: Props) {
);
}
-ScrollSpy.defaultProps = {
- // Shrinking root area from the bottom
- // Allows to fire observer event only if target scrolled up to top of the page)
- rootMargin: "0px 0px -85%"
-};