From e82f83fa5a7022d5e38c58c2b64982f5cba2fc21 Mon Sep 17 00:00:00 2001 From: alexfront Date: Fri, 9 Sep 2022 10:00:42 +0300 Subject: [PATCH] Use named export for useIntersectionObserver Signed-off-by: alexfront --- src/renderer/components/dock/logs/use-on-scroll-top.ts | 2 +- .../components/dock/logs/use-stick-to-bottom-on-logs-load.ts | 2 +- src/renderer/hooks/index.ts | 1 + src/renderer/hooks/useIntersectionObserver.ts | 4 +--- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/dock/logs/use-on-scroll-top.ts b/src/renderer/components/dock/logs/use-on-scroll-top.ts index 1452b0791a..95e20ca378 100644 --- a/src/renderer/components/dock/logs/use-on-scroll-top.ts +++ b/src/renderer/components/dock/logs/use-on-scroll-top.ts @@ -5,7 +5,7 @@ import type { RefObject } from "react"; import { useEffect } from "react"; -import useIntersectionObserver from "../../../hooks/useIntersectionObserver"; +import { useIntersectionObserver } from "../../../hooks"; import type { LogTabViewModel } from "./logs-view-model"; interface UseStickToBottomProps { diff --git a/src/renderer/components/dock/logs/use-stick-to-bottom-on-logs-load.ts b/src/renderer/components/dock/logs/use-stick-to-bottom-on-logs-load.ts index 3f2628f064..e59290ac68 100644 --- a/src/renderer/components/dock/logs/use-stick-to-bottom-on-logs-load.ts +++ b/src/renderer/components/dock/logs/use-stick-to-bottom-on-logs-load.ts @@ -5,7 +5,7 @@ import type { RefObject } from "react"; import { useEffect } from "react"; -import useIntersectionObserver from "../../../hooks/useIntersectionObserver"; +import { useIntersectionObserver } from "../../../hooks"; import type { LogTabViewModel } from "./logs-view-model"; interface UseStickToBottomProps { diff --git a/src/renderer/hooks/index.ts b/src/renderer/hooks/index.ts index 852f4d64d0..d6b06e416b 100644 --- a/src/renderer/hooks/index.ts +++ b/src/renderer/hooks/index.ts @@ -10,3 +10,4 @@ export * from "./useInterval"; export * from "./useMutationObserver"; export * from "./useResizeObserver"; export * from "./use-toggle"; +export * from "./useIntersectionObserver"; diff --git a/src/renderer/hooks/useIntersectionObserver.ts b/src/renderer/hooks/useIntersectionObserver.ts index 03faa47948..41d51ac8a4 100644 --- a/src/renderer/hooks/useIntersectionObserver.ts +++ b/src/renderer/hooks/useIntersectionObserver.ts @@ -37,7 +37,7 @@ interface IntersectionObserverOptions { rootMargin?: string; } -function useIntersectionObserver( +export function useIntersectionObserver( element: Element | null, { threshold = 0, @@ -64,5 +64,3 @@ function useIntersectionObserver( return entry; } - -export default useIntersectionObserver;